GigaOM / go-sphinx

11 stars 6 forks source link

fixed over-escaped single quotes in search query strings #29

Closed wluo closed 10 years ago

wluo commented 10 years ago

extra slashes are already removed by WP by the time we get the query string

see https://github.com/GigaOM/legacy-pro/issues/2794

methnen commented 10 years ago

:cactus: :dash:

misterbisson commented 10 years ago

Please confirm if WP has any conditionals that would affect the escaping.

Please add a reference to where in WP the escaping is being added. A link to the file in core Trac and the name of the method would be great.

wluo commented 10 years ago

sure thing. i was looking in wp-include/query.php's get_posts() function, where it calls parse_search() if a keyword search is specified. parse_search() calls stripslashes() on the search keywords which's why we didn't have to call it again in go-sphinx. it also urldecodes() the search string if it came from a POST, and strips newlines and carriage returns. and while this doesn't apply to us, WP then calls like_escape() and sql_sql() on each search term parsed out of the query string.

misterbisson commented 10 years ago

:pickles: