You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Steps to reproduce the issue
Search a word inside text with accented letters that are expressed as as 2 characters.
Example : é as the unicode character U+02CA and the letter "e"
Expected result
The word searched is highlighted properly
Actual result
The highlighting is moved to the left by 1 or more pixel
System information (as much as possible)
Joomla 3.4.4 on any browsers
Additional comments
In the file '/components/com_search/views/search/view.html.php' at the lines 173 and 180 there is variable to check if the string without accents is longer than the one without accents ( stating : "E.g. german umlauts like ä are converted to ae and so $pos calculated with $srow doesn't match for $row" );
Since in my example the string without is shorter than the one with accents, the recalculation of the position isn't triggered.
I would suggest changing both lines to use "not equal" instead of "greater than" so that the recalculation of the position happens when both strings aren't the same length.
Line 173 :
FROM
$correctPos = (mb_strlen($srow) > mb_strlen($row));
TO
$correctPos = (mb_strlen($srow) != mb_strlen($row));
Line 180 :
FROM
$correctPos = (JString::strlen($srow) > JString::strlen($row));
TO
$correctPos = (JString::strlen($srow) != JString::strlen($row));
Sorry if this wasn't the proper way to report an issue, this is my first time.
The text was updated successfully, but these errors were encountered:
Hi @Tinilmabard you created this issue sometime ago but have not provided a PR for people to evaluate. As no one else has shown any interest in providing the code and you have not then I am closing this issue at this time. If code is provided (a pull request) it can always be re-examined. Thanks for reporting the problem.
Steps to reproduce the issue
Search a word inside text with accented letters that are expressed as as 2 characters.
Example : é as the unicode character U+02CA and the letter "e"
Expected result
The word searched is highlighted properly
Actual result
The highlighting is moved to the left by 1 or more pixel
System information (as much as possible)
Joomla 3.4.4 on any browsers
Additional comments
In the file '/components/com_search/views/search/view.html.php' at the lines 173 and 180 there is variable to check if the string without accents is longer than the one without accents ( stating : "E.g. german umlauts like ä are converted to ae and so $pos calculated with $srow doesn't match for $row" );
Since in my example the string without is shorter than the one with accents, the recalculation of the position isn't triggered.
I would suggest changing both lines to use "not equal" instead of "greater than" so that the recalculation of the position happens when both strings aren't the same length.
Line 173 :
FROM
$correctPos = (mb_strlen($srow) > mb_strlen($row));
TO
$correctPos = (mb_strlen($srow) != mb_strlen($row));
Line 180 :
FROM
$correctPos = (JString::strlen($srow) > JString::strlen($row));
TO
$correctPos = (JString::strlen($srow) != JString::strlen($row));
Sorry if this wasn't the proper way to report an issue, this is my first time.
The text was updated successfully, but these errors were encountered: