?
avatar Tinilmabard
Tinilmabard
30 Sep 2015

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.

avatar Tinilmabard Tinilmabard - open - 30 Sep 2015
avatar vdespa
vdespa - comment - 5 Oct 2015

Hi @Tinilmabard and thank you for your issue report and proposed solution.

Would it be possible to create a Pull Request (PR) on github with your patch and to include testing instructions / maybe attach an image.

Thanks!


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/7990.

avatar chrisdavenport
chrisdavenport - comment - 8 May 2016

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.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/7990.

avatar chrisdavenport chrisdavenport - change - 8 May 2016
Status New Closed
Closed_Date 0000-00-00 00:00:00 2016-05-08 10:30:49
Closed_By chrisdavenport
avatar chrisdavenport
chrisdavenport - comment - 8 May 2016
avatar joomla-cms-bot joomla-cms-bot - close - 8 May 2016

Add a Comment

Login with GitHub to post a comment