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

Entering single quotes in search box is broken #23

Open
cgorringe opened this issue May 3, 2012 · 3 comments
Open

Entering single quotes in search box is broken #23

cgorringe opened this issue May 3, 2012 · 3 comments

Comments

@cgorringe
Copy link
Collaborator

Which means you're out of luck if searching for a person with an Irish last name...


Request:


A ActiveRecord::StatementInvalid occurred in searches#index:

PGError: ERROR: syntax error in tsquery: "'pam' & 'O'dea'"
: SELECT people.*, ts_rank_cd((to_tsvector('english', coalesce("people"."name", '') || ' ' || coalesce("people"."description", ''))),
to_tsquery('''pam'' & ''O''dea''')) as rank FROM "people" WHERE (to_tsvector('english', coalesce("people"."name", '') || ' ' || coalesce("people"."description", '')) @@ to_tsquery('''pam'' & ''O''dea''')) ORDER BY rank DESC
[RAILS_ROOT]/.bundle/gems/ruby/1.8/gems/activerecord-2.3.11/lib/active_record/connection_adapters/abstract_adapter.rb:227:in `log'

@mtravers
Copy link
Collaborator

mtravers commented May 3, 2012

http://xkcd.com/327/

@cgorringe
Copy link
Collaborator Author

I remember that one on xkcd!

I haven't tested if an SQL injection would work, though I'm somewhat
surprised it isn't using parameterized queries... (unless it is)

If I had my BACE dev machine with me right now I'd fix this...

-Carl

On Wed, 2012-05-02 at 18:32 -0700, Mike Travers wrote:

http://xkcd.com/327/


Reply to this email directly or view it on GitHub:
#23 (comment)

@cgorringe
Copy link
Collaborator Author

Looks like the bug is in the "texticle" gem. It's been fixed in a newer version of the gem, but the version available depends on a newer version of activerecord (if I remember correctly) which may be hard to upgrade? Maybe someone can figure this out.

herestomwiththeweather added a commit that referenced this issue Jun 2, 2021
fixing slicing of multibyte strings (fixes #23 and #61)
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