PHP Classes

Bug in escapeString function

Recommend this page to a friend!

      PHP Input Filter  >  All threads  >  Bug in escapeString function  >  (Un) Subscribe thread alerts  
Subject:Bug in escapeString function
Summary:Forgotten to write result back to string.
Messages:1
Author:Andri
Date:2008-01-22 23:38:12
 

  1. Bug in escapeString function   Reply   Report abuse  
Picture of Andri Andri - 2008-01-22 23:38:12
Ther is a little big but in escapeString()

Change line 307 and 309 from

if (version_compare(phpversion(),"4.3.0", "<")) mysql_escape_string($string);
else mysql_real_escape_string($string);

to

if (version_compare(phpversion(),"4.3.0", "<")) $string = mysql_escape_string($string);
else $string = mysql_real_escape_string($string);

Whiteout change the function has no effect and quotes don't get escaped.

Thx for sharing your nice class.

Nexangel