Bug #97986
closed
EXT:indexed_search search result description umlaut issue
Added by Benjamin Robinson over 2 years ago.
Updated almost 2 years ago.
Description
For a search term with an umlaut (e.g. "Ü"), the page is found, but the description does not output the relevant text snippet, but simply the text end of the page.
If you omit the umlaut from the search term, everything looks as it should (search term "beltat"):
With the umlaut, only the end of the text is output as the description (search term "Übeltat"):
Files
I can reproduce this with words on the page like überhaupt, Ärmel etc. But words like Brühe, is not a problem.
I have also tested with danish special chars like: æøå Words starting with special chars like: Æble doesn't work, but words like rød do.
So it's a problem when words starting with a special char.
I have found the problem, but not a solution yet.
$parts = preg_split('/' . $regExString . '/i', ' ' . $str . ' ', 20000, PREG_SPLIT_DELIM_CAPTURE);
This line (Line 799 SearchController.php) doesn't find a match, to highlight, when starting with a special char like Ü or Æ, but if the text is with lowercase ü and æ it does, if there is a match in text of course. The `/i` modifier should make it case-insensitive, but doesn't seem to work like expected.
Will see if I can figure out a solution.
Thanks to @Oliver Hader and @Frank Nägler for pointing me in the right direction. The solution was smaller than I expected.
PR will come asap.
- Status changed from New to Under Review
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
- Status changed from Resolved to Closed
Also available in: Atom
PDF