summaryrefslogtreecommitdiffstats
path: root/system/database/drivers/cubrid/cubrid_driver.php
diff options
context:
space:
mode:
Diffstat (limited to 'system/database/drivers/cubrid/cubrid_driver.php')
-rw-r--r--system/database/drivers/cubrid/cubrid_driver.php31
1 files changed, 5 insertions, 26 deletions
diff --git a/system/database/drivers/cubrid/cubrid_driver.php b/system/database/drivers/cubrid/cubrid_driver.php
index 06ece4bd9..6663868bd 100644
--- a/system/database/drivers/cubrid/cubrid_driver.php
+++ b/system/database/drivers/cubrid/cubrid_driver.php
@@ -295,42 +295,21 @@ class CI_DB_cubrid_driver extends CI_DB {
// --------------------------------------------------------------------
/**
- * Escape String
+ * Platform-dependant string escape
*
- * @param string $str
- * @param bool $like Whether or not the string will be used in a LIKE condition
+ * @param string
* @return string
*/
- public function escape_str($str, $like = FALSE)
+ protected function _escape_str($str)
{
- if (is_array($str))
- {
- foreach ($str as $key => $val)
- {
- $str[$key] = $this->escape_str($val, $like);
- }
-
- return $str;
- }
-
if (function_exists('cubrid_real_escape_string') &&
(is_resource($this->conn_id)
OR (get_resource_type($this->conn_id) === 'Unknown' && preg_match('/Resource id #/', strval($this->conn_id)))))
{
- $str = cubrid_real_escape_string($str, $this->conn_id);
- }
- else
- {
- $str = addslashes($str);
- }
-
- // escape LIKE condition wildcards
- if ($like === TRUE)
- {
- return str_replace(array('%', '_'), array('\\%', '\\_'), $str);
+ return cubrid_real_escape_string($str, $this->conn_id);
}
- return $str;
+ return addslashes($str);
}
// --------------------------------------------------------------------