[pLog-svn] r5858 - plog/branches/lifetype-1.2/class/database

jondaley at devel.lifetype.net jondaley at devel.lifetype.net
Wed Aug 22 16:31:42 EDT 2007


Author: jondaley
Date: 2007-08-22 16:31:42 -0400 (Wed, 22 Aug 2007)
New Revision: 5858

Modified:
   plog/branches/lifetype-1.2/class/database/db.class.php
Log:
working on the famous removing backslash problem. We don't need to check magic_quotes_gpc here, because any data coming in from the outside should have been grabbed using the request class, which already stripped out the slashes.

Modified: plog/branches/lifetype-1.2/class/database/db.class.php
===================================================================
--- plog/branches/lifetype-1.2/class/database/db.class.php	2007-08-22 20:06:44 UTC (rev 5857)
+++ plog/branches/lifetype-1.2/class/database/db.class.php	2007-08-22 20:31:42 UTC (rev 5858)
@@ -145,8 +145,7 @@
 
 		/**
 		 * Prepares a string for an SQL query by escaping apostrophe
-		 * characters. If the PHP configuration setting 'magic_quotes_gpc'
-		 * is set to ON, it will first strip the added slashes. Apostrophe
+		 * characters. Apostrophe
 		 * characters are doubled, conforming with the ANSI SQL standard.
 		 * The SQL parser makes sure that the escape token is not entered
 		 * in the database so there is no need to modify the data when it
@@ -157,18 +156,8 @@
 		 * @access public
 		 */
 		function qstr($string) {
-
- 			if (get_magic_quotes_gpc()) {
-				$string = stripslashes($string);
-				//$string = stripslashes($string);
-		                $string = str_replace('\\\\', '\\', $string);
-                		$string = str_replace("\\'", "'", $string);
-         		        $string = str_replace('\\"', '"', $string);
- 			}
- 
 			$string = str_replace("\\", "\\\\", $string);
  			$string = str_replace("'", "''", $string);
-
 			return $string;
 		}
     }



More information about the pLog-svn mailing list