Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect Highligthing in com_search #7990

Closed
Tinilmabard opened this issue Sep 30, 2015 · 3 comments
Closed

Incorrect Highligthing in com_search #7990

Tinilmabard opened this issue Sep 30, 2015 · 3 comments

Comments

@Tinilmabard
Copy link

Tinilmabard commented Sep 30, 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.

@vdespa
Copy link

vdespa commented Oct 5, 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.

@chrisdavenport
Copy link
Contributor

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.

@chrisdavenport
Copy link
Contributor

Set to "closed" on behalf of @chrisdavenport by The JTracker Application at issues.joomla.org/joomla-cms/7990

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants