Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Doesn't work with "quotes"' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Doesn't work with "quotes"
Authored by: pbx on May 27, '03 04:58:10PM
Change this: $q = urldecode($_GET['q']); to this: $q = urldecode(stripslashes($_GET['q'])); This assumes that magic_quotes_gpc is ON (that's what is escaping the quotes in the first place), but shouldn't have any negative effect if it's off.

I made this fix in my lazysearch script as well.

[ Reply to This | # ]
Thanks!
Authored by: jason mark on May 28, '03 04:39:42PM

You rock man....



[ Reply to This | # ]
Doesn't work with "quotes"
Authored by: discordantus on May 29, '03 06:41:38PM
actually, it will cause problems if magic quoting is off... it will eat any backslashes. The following code checks first to see if they are on or not:

if (get_magic_quotes_gpc()) {
	$q = utf8_decode(stripslashes($_GET['q']));
else
	$q = utf8_decode($_GET['q']);
if you ever distribute the script, it should check for magic quoting something like that.

[ Reply to This | # ]
Yes
Authored by: pbx on May 30, '03 10:00:06AM

You're correct -- when I said it was unlikely to cause problems I was referring to the fact that the backslash is not a meaningful character for most search engines. But your way (with proper bracketing of course) is safest.



[ Reply to This | # ]