James liu wrote:
> first, u should escape some string like (code by php)
> 
>> function escapeChars($string) {
>>
> $string = str_replace("&", "&", $string);
> 
> $string = str_replace("<", "&lt;", $string);
> 
> $string = str_replace(">", "&gt;", $string);
> 
> $string = str_replace("'", "&apos;", $string);
> 
> $string = str_replace('"', "&quot;", $string);
> 
> 
> return $string;
> 
> }

php has this as a built in function.

$string = htmlentities($string);

that's what i use to protect my solr input.

-jsd-

Reply via email to