Skip to content

Commit 744b418

Browse files
astehlikirnnr
authored andcommitted
[BUGFIX] Prevent PHP segfault when content gets too long
The regular expression for detecting the TYPO3SEARCH_begin / TYPO3SEARCH_end markers is modified to prevent PHP segfaults when the content of the page gets too long, see: https://bugs.php.net/bug.php?id=45735 Resolves: #66346 Change-Id: Ic3f73098ce4f8c56e4101fefba6ca7e839176d95
1 parent 91c345e commit 744b418

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Classes/Typo3PageContentExtractor.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,9 @@ public function getIndexableContent() {
6969
* @return string HTML markup found between TYPO3SEARCH markers
7070
*/
7171
protected function extractContentMarkedForIndexing($html) {
72-
preg_match_all('/\<\!\-\-[\s]?TYPO3SEARCH_begin[\s]?\-\-\>(.|\s)*?\<\!\-\-[\s]?TYPO3SEARCH_end[\s]?\-\-\>/mi', $html, $indexableContents);
72+
preg_match_all('/<!--\s*?TYPO3SEARCH_begin\s*?-->.*?<!--\s*?TYPO3SEARCH_end\s*?-->/mis', $html, $indexableContents);
7373
$indexableContent = implode($indexableContents[0], '');
74-
74+
7575
if(empty($indexableContent) && $GLOBALS['TSFE']->tmpl->setup['plugin.']['tx_solr.']['logging.']['indexing.']['missingTypo3SearchMarkers']) {
7676
t3lib_div::devLog('No TYPO3SEARCH markers found.', 'solr', 2);
7777
}

0 commit comments

Comments
 (0)