[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ic] swish search - quotes


On 02/07/2007 01:06 PM, Dan Bergan wrote:
> However it looks like I will have to do some hacking in Swish.pm it
> looks like quotes are always removed as "unsafe charachers":
> $spec =~ s/[^-\w()"\s\*]+//g
>     and $CGI::values{debug}
>     and ::logError("Removed unsafe characters from search string");
> 
> (My regex skills may be a bit rusty, so please correct me if I'm reading
> either of these wrong!)
> 
> Does this seem like a reasonable thing for me to do in Swish.pm:
> #removed quote char (") from regex
> $spec =~ s/[^-\w()\s\*]+//g
>     and $CGI::values{debug}
>     and ::logError("Removed unsafe characters from search string");

You got it backwards, the ^ negates the character set, so it's removing
characters that *don't* match anything in the set.  " is explicitly allowed.

Peter

_______________________________________________
interchange-users mailing list
suppressed
http://www.icdevgroup.org/mailman/listinfo/interchange-users


Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.