#105737Indexed search causes crash
Description
After inserting a link, saving and displaying it, I get the following error:
clipboard-202412011724-koo8c.png
See error log.
Reviews 3
Files 5
History 1227
Show 2 earlier messages
-
Guido Twieling commented <span data-processor="relativetime" data-value="2024-12-01T16:55:33+00:00" > 12/01/24, 16:55 </span>
-
Chris Müller commented <span data-processor="relativetime" data-value="2024-12-01T17:10:29+00:00" > 12/01/24, 17:10 </span>
Looks like an error occurred in using preg_replace(), for whatever reason:
https://www.php.net/manual/en/function.preg-replace.php#refsect1-function.preg-replace-returnvalues
Then $bodyDescription is set to null.
-
Garvin Hicking commented and changed status
NewNeeds Feedback <span data-processor="relativetime" data-value="2024-12-01T20:59:14+00:00" > 12/01/24, 20:59 </span>Could you please give more details where exactly you insert what. Thank you!
-
Guido Twieling commented and changed attached source after reopen.txt attached source before saveing.txt <span data-processor="relativetime" data-value="2024-12-02T07:59:20+00:00" > 12/02/24, 07:59 </span>
Hello.
I just inserted a text element with a table. I attached the CKeditor source code. -
Garvin Hicking commented <span data-processor="relativetime" data-value="2024-12-04T08:34:03+00:00" > 12/04/24, 08:34 </span>
I tried to reproduce this but could not get the error you describe.
You seem to be using special configuration or plugins because you’re using `` tags in the RTE which isn’t possible by default. Can you please also post your CKEditor YAML configuration?
To speed up debugging maybe we can check what’s going on with the failing regular expression. Could you edit your file
/var/www/html/vendor/typo3/cms-indexed-search/Classes/Indexer.phpand in Line 877 replace this:$bodyDescription = preg_replace('/\s+/u', ' ', $indexingDataDto->body); // Shorten the string. If the database has the wrong character set, // the string is probably truncated again. $bodyDescription = \mb_strcut($bodyDescription, 0, $maxL, 'utf-8');to this:
$bodyDescription = preg_replace('/\s+/u', ' ', $indexingDataDto->body); $fp = fopen('/var/www/html/var/typo3temp/ckeditor.log', 'a'); fwrite($fp, "Input bodyDescription:\n" . $indexingDataDto->body . "\n----After replacement:\n" . $bodyDescription . "\n====\n"); // Shorten the string. If the database has the wrong character set, // the string is probably truncated again. $bodyDescription = \mb_strcut($bodyDescription, 0, $maxL, 'utf-8');Then it should create a logfile in
/var/www/html/var/typo3temp/ckeditor.logwhich you could post after saving and the error occurs.You could try if this helps:
$bodyDescription = (string) preg_replace('/\s+/u', ' ', $indexingDataDto->body);This should prevent a possible preg_replace output to be null (but would then not index anything, so that’s just a workaround for the PHP error, not a real fix).
-
Guido Twieling commented <span data-processor="relativetime" data-value="2024-12-04T17:25:36+00:00" > 12/04/24, 17:25 </span>
Hello Garvin.
I have attached the ckeditor.log. I tested it a bit. The error only occurs when I link files. When I look at the log, it contains the content of the linked files. -
Guido Twieling changed attached ckeditor.log <span data-processor="relativetime" data-value="2024-12-04T18:26:25+00:00" > 12/04/24, 18:26 </span>
-
Garvin Hicking commented and changed status
Needs FeedbackClosed <span data-processor="relativetime" data-value="2024-12-04T22:37:22+00:00" > 12/04/24, 22:37 </span>Thanks for the quick feedback and letting me know. I’ll close this for now as suggested.
(Removal of the attributes should also be configurable through the RTE YAML Processing directives though!)
-
Sebastian Mendel commented <span data-processor="relativetime" data-value="2025-10-26T21:48:03+00:00" > 10/26/25, 21:48 </span>
Hello,
We’ve been investigating this TypeError from our extension’s side (netresearch/t3x-rte_ckeditor_image#309) and wanted to share our findings.
The crash occurs in vendor/typo3/cms-indexed-search/Classes/Indexer.php:880 when mb_strcut() receives a null value instead of a string. This happens when indexed_search processes pages with images wrapped in tags where certain link attributes may be missing or malformed.
We’ve identified that our CKEditor image extension was producing link structures that could trigger this crash. We’re actively fixing this in PR #387 (https://github.com/netresearch/t3x-rte_ckeditor_image/pull/387) to ensure proper link attribute preservation and well-formed HTML output.
While we’re addressing our extension’s output, we wanted to point out that the crash could potentially be triggered by other content sources as well – other extensions, user-generated content, legacy data from migrations, etc.
A null-safety check in indexed_search’s Indexer::bodyDescription() method would prevent similar crashes regardless of the content source. This seems like it would benefit overall system stability, especially since the indexing process handles content from various origins.
Best regards,
Sebastian Mendel
rte_ckeditor_image Extension Maintainer -
Garvin Hicking commented <span data-processor="relativetime" data-value="2025-10-27T05:53:46+00:00" > 10/27/25, 05:53 </span>
cybot_tmsebastian.mendel Hey thanks for this detailed feedback. Would you like to contribute a patch for this so we can attribute it for you? Otherwise I’d be happy to create one / look into it for the mentioned place. -
Gerrit Code Review pushed patch set 1 for main to change 91263 status
ClosedUnder Review <span data-processor="relativetime" data-value="2025-10-27T09:51:12+00:00" > 10/27/25, 09:51 </span> -
Gerrit Code Review pushed patch set 2 for main to change 91263 <span data-processor="relativetime" data-value="2025-10-27T10:13:22+00:00" > 10/27/25, 10:13 </span>
-
Gerrit Code Review pushed patch set 1 for main to change 91264 <span data-processor="relativetime" data-value="2025-10-27T10:31:27+00:00" > 10/27/25, 10:31 </span>
-
Gerrit Code Review pushed patch set 3 for main to change 91263 <span data-processor="relativetime" data-value="2025-10-27T10:32:10+00:00" > 10/27/25, 10:32 </span>
-
Gerrit Code Review pushed patch set 4 for main to change 91263 <span data-processor="relativetime" data-value="2025-10-27T10:49:14+00:00" > 10/27/25, 10:49 </span>
-
Gerrit Code Review pushed patch set 5 for main to change 91263 <span data-processor="relativetime" data-value="2025-10-27T12:16:21+00:00" > 10/27/25, 12:16 </span>
-
Gerrit Code Review pushed patch set 6 for main to change 91263 <span data-processor="relativetime" data-value="2025-10-27T12:17:33+00:00" > 10/27/25, 12:17 </span>
-
Gerrit Code Review pushed patch set 7 for main to change 91263 <span data-processor="relativetime" data-value="2025-10-27T12:17:48+00:00" > 10/27/25, 12:17 </span>
-
Gerrit Code Review pushed patch set 8 for main to change 91263 <span data-processor="relativetime" data-value="2025-10-27T12:30:31+00:00" > 10/27/25, 12:30 </span>
-
Gerrit Code Review pushed patch set 9 for main to change 91263 <span data-processor="relativetime" data-value="2025-10-27T12:34:54+00:00" > 10/27/25, 12:34 </span>
-
Gerrit Code Review pushed patch set 10 for main to change 91263 <span data-processor="relativetime" data-value="2025-10-27T12:37:09+00:00" > 10/27/25, 12:37 </span>
-
Gerrit Code Review pushed patch set 11 for main to change 91263 <span data-processor="relativetime" data-value="2025-10-30T18:53:50+00:00" > 10/30/25, 18:53 </span>
-
Gerrit Code Review pushed patch set 12 for main to change 91263 <span data-processor="relativetime" data-value="2025-10-30T18:55:01+00:00" > 10/30/25, 18:55 </span>
-
Gerrit Code Review pushed patch set 1 for 13.4 to change 91390 <span data-processor="relativetime" data-value="2025-10-31T11:43:20+00:00" > 10/31/25, 11:43 </span>
-
Gerrit Code Review pushed patch set 2 for 13.4 to change 91390 <span data-processor="relativetime" data-value="2025-10-31T11:50:34+00:00" > 10/31/25, 11:50 </span>
-
Netresearch DTT GmbH commented and changed status
Under ReviewResolved done0 %100 % <span data-processor="relativetime" data-value="2025-10-31T11:55:09+00:00" > 10/31/25, 11:55 </span>Applied in changeset commit:a47433530a0a2a4b9ff95211af81f34e0a86db22.
-
Benni Mack changed status
ResolvedClosed <span data-processor="relativetime" data-value="2025-12-02T14:31:39+00:00" > 12/02/25, 14:31 </span>
Forgot to write: After refreshing (F5) the page is displayed. The page that was created shows a simple 5-column table with download links for files. What I also noticed is that the alt text and target _blank are deleted after repeated saving.