Bug #22296
closedIS cannot not index files if absRefPrefix is set and indexExternalURLs is not
0%
Description
If config.absRefPrefix is set, indexed search will not index files. There are several problems in the code:
- all non–relative URLs are treated as external. This if indexExternalURLs is not set in the extension (!!!) properties, no files will be indexed at all
- if config.absRefPrefix is a slash, indexed search will not find any files to index. Files will be indexed only if config.absRefPrefix looks like a baseURL
The attached patch solves the issue in the following way:
- it adds several ways to detect of the file is local. Currently files are always fetched with HTTP, which is a waste of resources. There are several methods for this (absRefPrefix, absolute URL without host, current host, etc)
- it adds an additional check for local files in case of schema is present
- it avoids anchors when they present in the href at position 0
After applying the patch, indexing of files works like a charm and it does not cause any unnecessary HTTP requests.
Revisions 7782 (4.3) and 7780 (4.4)
(issue imported from #M13858)
Files
Updated by Dmitry Dulepov over 14 years ago
v3 adds support for relative paths, unit tests and backpath resolving
Updated by Dmitry Dulepov over 14 years ago
v5 fixes behavior change in T3var processing and adds unit tests for the whole stuff
Updated by Dmitry Dulepov over 14 years ago
v6: more refactoring, more unit tests
Updated by Steffen Ritter over 14 years ago
v7 fixes uninitialized return values, thanks to Oliver Klee pointing this out