Skip to content
This repository was archived by the owner on May 4, 2021. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 6 additions & 22 deletions Classes/Typo3PageContentExtractor.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,27 +69,11 @@ public function getIndexableContent() {
* @return string HTML markup found between TYPO3SEARCH markers
*/
protected function extractContentMarkedForIndexing($html) {
$explodedContent = preg_split('/\<\!\-\-[\s]?TYPO3SEARCH_/', $html);
$indexableContent = '';

if(count($explodedContent) > 1) {

foreach($explodedContent as $explodedContentPart) {
$contentPart = explode('-->', $explodedContentPart, 2);

if (trim($contentPart[0]) == 'begin') {
$indexableContent .= $contentPart[1];
$previousExplodedContentPart = '';
} elseif (trim($contentPart[0]) == 'end') {
$indexableContent .= $previousExplodedContentPart;
} else {
$previousExplodedContentPart = $explodedContentPart;
}
}
} else {
if ($GLOBALS['TSFE']->tmpl->setup['plugin.']['tx_solr.']['logging.']['indexing.']['missingTypo3SearchMarkers']) {
t3lib_div::devLog('No TYPO3SEARCH markers found.', 'solr', 2);
}
preg_match_all('/\<\!\-\-[\s]?TYPO3SEARCH_begin[\s]?\-\-\>(.|\s)*?\<\!\-\-[\s]?TYPO3SEARCH_end[\s]?\-\-\>/mi', $html, $indexableContents);
$indexableContent = implode($indexableContents[0], '');

if(empty($indexableContent) && $GLOBALS['TSFE']->tmpl->setup['plugin.']['tx_solr.']['logging.']['indexing.']['missingTypo3SearchMarkers']) {
t3lib_div::devLog('No TYPO3SEARCH markers found.', 'solr', 2);
}

return $indexableContent;
Expand Down Expand Up @@ -134,4 +118,4 @@ public function getPageBody() {
include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/solr/Classes/Typo3PageContentExtractor.php']);
}

?>
?>