You are here:  » Search and Replace Filter Case Sensitivity


Search and Replace Filter Case Sensitivity

Submitted by noodles on Sat, 2006-11-25 12:56 in

I noticed this filter seems to be case sensitive, is there an easy way to make it case insensitive?

Thanks
Dave

Submitted by support on Sat, 2006-11-25 19:57

Hi Dave,

Sure, if you edit includes/filter.php and look for the following code in the Search and Replace block:

return trim(str_replace($filter_data["search"],$filter_data["replace"],$text));

(line 50 in the distribution) and change this to use the str_ireplace() function as follows which is the case insensitive version of the same function:

return trim(str_ireplace($filter_data["search"],$filter_data["replace"],$text));

That should do the trick...
Cheers,
David.

Submitted by noodles on Sat, 2006-11-25 21:45

Thanks for your help, I upgraded to PHP 5.2 and it worked a treat.

Dave