Skip to content

Commit 86bdf28

Browse files
authored
[5.1] Finder: Allow finder plugins to output spaces (#43093)
1 parent 3698eea commit 86bdf28

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

administrator/components/com_finder/src/Controller/IndexerController.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@ public function start()
9696

9797
$output = ob_get_contents();
9898

99-
if ($output) {
99+
// Finder plugins should not create output of any kind. If there is output, that very likely is the result of a PHP error.
100+
if (trim($output)) {
100101
throw new \Exception(Text::_('COM_FINDER_AN_ERROR_HAS_OCCURRED'));
101102
}
102103

@@ -201,7 +202,8 @@ public function batch()
201202

202203
$output = ob_get_contents();
203204

204-
if ($output) {
205+
// Finder plugins should not create output of any kind. If there is output, that very likely is the result of a PHP error.
206+
if (trim($output)) {
205207
throw new \Exception(Text::_('COM_FINDER_INDEXER_ERROR_PLUGIN_FAILURE'));
206208
}
207209

@@ -251,7 +253,8 @@ public function optimize()
251253

252254
$output = ob_get_contents();
253255

254-
if ($output) {
256+
// Finder plugins should not create output of any kind. If there is output, that very likely is the result of a PHP error.
257+
if (trim($output)) {
255258
throw new \Exception(Text::_('COM_FINDER_AN_ERROR_HAS_OCCURRED'));
256259
}
257260

0 commit comments

Comments
 (0)