Skip to content

Commit ff27fc9

Browse files
authored
fix(AdminController): ob_end_clean without content creates error
1 parent c82ca02 commit ff27fc9

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

controllers/admin/AdminConfigureSlidesController.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@ class AdminConfigureSlidesController extends ModuleAdminController
2222
public function ajaxProcessUpdateSlidesPosition()
2323
{
2424
if (empty(Tools::getValue('action')) || Tools::getValue('action') != 'updateSlidesPosition' || empty(Tools::getValue('slides'))) {
25-
ob_end_clean();
25+
if (ob_get_contents()) {
26+
ob_end_clean();
27+
}
28+
2629
header('Content-Type: application/json');
2730
$this->ajaxRender(json_encode(['error' => true]));
2831
exit;
@@ -40,7 +43,10 @@ public function ajaxProcessUpdateSlidesPosition()
4043
// Wipe module cache
4144
$this->module->clearCache();
4245

43-
ob_end_clean();
46+
if (ob_get_contents()) {
47+
ob_end_clean();
48+
}
49+
4450
header('Content-Type: application/json');
4551
$this->ajaxRender(json_encode(['success' => true]));
4652
exit;

0 commit comments

Comments
 (0)