[geeklog-hg] geeklog: Removed the optional second argument of DB_escapeString

geeklog-cvs at lists.geeklog.net geeklog-cvs at lists.geeklog.net
Tue Jan 22 09:41:54 EST 2013


changeset 8929:a3651438cb34
url:  http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/a3651438cb34
user: Kenji ITO <mystralkk at gmail.com>
date: Tue Jan 22 23:40:29 2013 +0900
description:
Removed the optional second argument of DB_escapeString

diffstat:

 system/databases/mssql.class.php  |  7 +------
 system/databases/mysql.class.php  |  7 +------
 system/databases/mysqli.class.php |  7 +------
 system/databases/pgsql.class.php  |  7 +------
 system/lib-database.php           |  5 ++---
 5 files changed, 6 insertions(+), 27 deletions(-)

diffs (108 lines):

diff -r d518b59a9fd5 -r a3651438cb34 system/databases/mssql.class.php
--- a/system/databases/mssql.class.php	Tue Jan 22 20:23:12 2013 +0900
+++ b/system/databases/mssql.class.php	Tue Jan 22 23:40:29 2013 +0900
@@ -1181,17 +1181,12 @@
     * Escapes a string so that it can be safely used in a query
     *
     * @param   string   $str          a string to be escaped
-    * @param   boolean  $isEnclose    whether to enclose the string with "'"
     * @return  string
     */
-    function dbEscapeString($str, $isEnclose = TRUE)
+    function dbEscapeString($str)
     {
         $retval = str_replace("'", "''", $str);
 
-        if ($isEnclose) {
-            $retval = "'" . $retval . "'";
-        }
-
         return $retval;
     }
 
diff -r d518b59a9fd5 -r a3651438cb34 system/databases/mysql.class.php
--- a/system/databases/mysql.class.php	Tue Jan 22 20:23:12 2013 +0900
+++ b/system/databases/mysql.class.php	Tue Jan 22 23:40:29 2013 +0900
@@ -834,17 +834,12 @@
     * Escapes a string so that it can be safely used in a query
     *
     * @param   string   $str          a string to be escaped
-    * @param   boolean  $isEnclose    whether to enclose the string with "'"
     * @return  string
     */
-    function dbEscapeString($str, $isEnclose = TRUE)
+    function dbEscapeString($str)
     {
         $retval = mysql_real_escape_string($str, $this->_db);
 
-        if ($isEnclose) {
-            $retval = "'" . $retval . "'";
-        }
-
         return $retval;
     }
 
diff -r d518b59a9fd5 -r a3651438cb34 system/databases/mysqli.class.php
--- a/system/databases/mysqli.class.php	Tue Jan 22 20:23:12 2013 +0900
+++ b/system/databases/mysqli.class.php	Tue Jan 22 23:40:29 2013 +0900
@@ -784,17 +784,12 @@
     * Escapes a string so that it can be safely used in a query
     *
     * @param   string   $str          a string to be escaped
-    * @param   boolean  $isEnclose    whether to enclose the string with "'"
     * @return  string
     */
-    public function dbEscapeString($str, $isEnclose = TRUE)
+    public function dbEscapeString($str)
     {
         $retval = $this->_db->real_escape_string($str);
 
-        if ($isEnclose) {
-            $retval = "'" . $retval . "'";
-        }
-
         return $retval;
     }
 
diff -r d518b59a9fd5 -r a3651438cb34 system/databases/pgsql.class.php
--- a/system/databases/pgsql.class.php	Tue Jan 22 20:23:12 2013 +0900
+++ b/system/databases/pgsql.class.php	Tue Jan 22 23:40:29 2013 +0900
@@ -915,17 +915,12 @@
     * Escapes a string so that it can be safely used in a query
     *
     * @param   string   $str          a string to be escaped
-    * @param   boolean  $isEnclose    whether to enclose the string with "'"
     * @return  string
     */
-    function dbEscapeString($str, $isEnclose = TRUE)
+    function dbEscapeString($str)
     {
         $retval = pg_escape_string($this->_db, $str);
 
-        if ($isEnclose) {
-            $retval = "'" . $retval . "'";
-        }
-
         return $retval;
     }
 
diff -r d518b59a9fd5 -r a3651438cb34 system/lib-database.php
--- a/system/lib-database.php	Tue Jan 22 20:23:12 2013 +0900
+++ b/system/lib-database.php	Tue Jan 22 23:40:29 2013 +0900
@@ -666,14 +666,13 @@
 * Escapes a string so that it can be safely used in a query
 *
 * @param   string   $str          a string to be escaped
-* @param   boolean  $isEnclose    whether to enclose the string with "'"
 * @return  string
 */
-function DB_escapeString($str, $isEnclose = TRUE)
+function DB_escapeString($str)
 {
     global $_DB;
 
-	return $_DB->dbEscapeString($str, $isEnclose);
+	return $_DB->dbEscapeString($str);
 }
 
 ?>



More information about the geeklog-cvs mailing list