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

Problem in search show view with regex #13

Closed
agronemann opened this issue Jan 8, 2012 · 7 comments
Closed

Problem in search show view with regex #13

agronemann opened this issue Jan 8, 2012 · 7 comments

Comments

@agronemann
Copy link

Hello!

There is a problem with this line of code in the searches show view (Line 12):

<%= link_to raw(result.title.gsub(/(#{params[:query]})/i,'<mark>\1</mark>')), result_url(result) %>

When the query param contains regex like characters it goes nuts (of course).

@ugisozols
Copy link
Member

Hey @HighCode,

Would you be willing to fix this? Thanks.

@agronemann
Copy link
Author

I not sure how to make a fix for this, sorry. :-(

@ugisozols
Copy link
Member

Don't worry - I'll take a look at it tomorrow.

@agronemann
Copy link
Author

Cool! You do not hurry on my account. Have a nice day! :-)

@ugisozols
Copy link
Member

Can you post steps to reproduce? I can't break it myself :)

@agronemann
Copy link
Author

Try to search for:

Hello world :-)

Then the gsub will look like this:

gsub(/(Hello world :-))/i,'<mark>\1</mark>')

Which fails.

@ugisozols
Copy link
Member

@HighCode please test it and let me know if it works for you.

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

No branches or pull requests

2 participants