diff --git a/administrator/components/com_finder/src/Controller/IndexerController.php b/administrator/components/com_finder/src/Controller/IndexerController.php index 6fa43f72bb89d..f232264c18826 100644 --- a/administrator/components/com_finder/src/Controller/IndexerController.php +++ b/administrator/components/com_finder/src/Controller/IndexerController.php @@ -96,7 +96,8 @@ public function start() $output = ob_get_contents(); - if ($output) { + // Finder plugins should not create output of any kind. If there is output, that very likely is the result of a PHP error. + if (trim($output)) { throw new \Exception(Text::_('COM_FINDER_AN_ERROR_HAS_OCCURRED')); } @@ -201,7 +202,8 @@ public function batch() $output = ob_get_contents(); - if ($output) { + // Finder plugins should not create output of any kind. If there is output, that very likely is the result of a PHP error. + if (trim($output)) { throw new \Exception(Text::_('COM_FINDER_INDEXER_ERROR_PLUGIN_FAILURE')); } @@ -251,7 +253,8 @@ public function optimize() $output = ob_get_contents(); - if ($output) { + // Finder plugins should not create output of any kind. If there is output, that very likely is the result of a PHP error. + if (trim($output)) { throw new \Exception(Text::_('COM_FINDER_AN_ERROR_HAS_OCCURRED')); }