Update of /cvsroot/phpmp/phpMP/dba
In directory sc8-pr-cvs1:/tmp/cvs-serv21745
Modified Files:
mysql.dba
Log Message:
Added escapeString() function to add slashes if they haven't already been added.
Index: mysql.dba
===================================================================
RCS file: /cvsroot/phpmp/phpMP/dba/mysql.dba,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -r1.20 -r1.21
*** mysql.dba 1 Dec 2002 03:47:21 -0000 1.20
--- mysql.dba 31 Jan 2003 07:07:54 -0000 1.21
***************
*** 157,160 ****
--- 157,172 ----
return @mysql_affected_rows($db);
}
+
+ function escapeString($string) {
+ if( stripslashes($string) == $string ) // Will be true if no slashes were removed.
+ {
+ addslashes($string); // We'll add the slashes because they haven't already been added.
+ return true;
+ }
+ else // Slashes have already been added (hopefully only once).
+ {
+ return true;
+ }
+ }
}
|