From 0b6a492ce1092172b9e3445e674ff9a344d33650 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 10 Jan 2013 16:53:44 +0200 Subject: Unify escape_str() array input and LIKE logic Added protected method _escape_str() to deal with quote escaping. --- system/database/drivers/sqlsrv/sqlsrv_driver.php | 37 ------------------------ 1 file changed, 37 deletions(-) (limited to 'system/database/drivers/sqlsrv') diff --git a/system/database/drivers/sqlsrv/sqlsrv_driver.php b/system/database/drivers/sqlsrv/sqlsrv_driver.php index a6f2d5537..09e6b8c9a 100644 --- a/system/database/drivers/sqlsrv/sqlsrv_driver.php +++ b/system/database/drivers/sqlsrv/sqlsrv_driver.php @@ -221,43 +221,6 @@ class CI_DB_sqlsrv_driver extends CI_DB { // -------------------------------------------------------------------- - /** - * Escape String - * - * @param string $str - * @param bool $like Whether or not the string will be used in a LIKE condition - * @return string - */ - public function escape_str($str, $like = FALSE) - { - if (is_array($str)) - { - foreach ($str as $key => $val) - { - $str[$key] = $this->escape_str($val, $like); - } - - return $str; - } - - // Escape single quotes - $str = str_replace("'", "''", remove_invisible_characters($str)); - - // escape LIKE condition wildcards - if ($like === TRUE) - { - return str_replace( - array($this->_like_escape_chr, '%', '_'), - array($this->_like_escape_chr.$this->_like_escape_chr, $this->_like_escape_chr.'%', $this->_like_escape_chr.'_'), - $str - ); - } - - return $str; - } - - // -------------------------------------------------------------------- - /** * Affected Rows * -- cgit v1.2.3-24-g4f1b