[TASK] Add tool-function to strip PATH_site-part of paths
[Packages/TYPO3.CMS.git] / typo3 / sysext / indexed_search / Classes / Hook / CrawlerHook.php
index 57a71cb..f5f29fe 100644 (file)
@@ -300,7 +300,7 @@ class CrawlerHook {
                                $indexerObj->hash['phash'] = -1;
                                // EXPERIMENT - but to avoid phash_t3 being written to file sections (otherwise they are removed when page is reindexed!!!)
                                // Index document:
-                               $indexerObj->indexRegularDocument(substr($readpath, strlen(PATH_site)), TRUE);
+                               $indexerObj->indexRegularDocument(\TYPO3\CMS\Core\Utility\PathUtility::stripPathSitePrefix($readpath), TRUE);
                        } elseif (@is_dir($readpath)) {
                                // If dir, read content and create new pending items for log:
                                // Select files and directories in path: