From 513ce070bfcbb2b59d0aabd1732b7666b90b4d83 Mon Sep 17 00:00:00 2001
From: Derek Allard
Date: Sun, 18 May 2008 12:23:11 +0000
Subject: Moved the _has_operators() function into DB_driver from
DB_active_rec.
---
system/database/DB_active_rec.php | 20 --------------------
system/database/DB_driver.php | 22 ++++++++++++++++++++++
user_guide/changelog.html | 3 ++-
3 files changed, 24 insertions(+), 21 deletions(-)
diff --git a/system/database/DB_active_rec.php b/system/database/DB_active_rec.php
index 3cb39822c..dcf9d3868 100644
--- a/system/database/DB_active_rec.php
+++ b/system/database/DB_active_rec.php
@@ -1394,27 +1394,7 @@ class CI_DB_active_record extends CI_DB_driver {
{
return $this->from($table);
}
-
- // --------------------------------------------------------------------
-
- /**
- * Tests whether the string has an SQL operator
- *
- * @access private
- * @param string
- * @return bool
- */
- function _has_operator($str)
- {
- $str = trim($str);
- if ( ! preg_match("/(\s|<|>|!|=|is null|is not null)/i", $str))
- {
- return FALSE;
- }
- return TRUE;
- }
-
// --------------------------------------------------------------------
/**
diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php
index eeaf6ea78..60f51d757 100644
--- a/system/database/DB_driver.php
+++ b/system/database/DB_driver.php
@@ -933,7 +933,9 @@ class CI_DB_driver {
function update_string($table, $data, $where)
{
if ($where == '')
+ {
return false;
+ }
$fields = array();
foreach($data as $key => $val)
@@ -971,6 +973,26 @@ class CI_DB_driver {
// --------------------------------------------------------------------
+ /**
+ * Tests whether the string has an SQL operator
+ *
+ * @access private
+ * @param string
+ * @return bool
+ */
+ function _has_operator($str)
+ {
+ $str = trim($str);
+ if ( ! preg_match("/(\s|<|>|!|=|is null|is not null)/i", $str))
+ {
+ return FALSE;
+ }
+
+ return TRUE;
+ }
+
+ // --------------------------------------------------------------------
+
/**
* Prep the table name - simply adds the table prefix if needed
*
diff --git a/user_guide/changelog.html b/user_guide/changelog.html
index 2188c1203..5fa7c60a3 100644
--- a/user_guide/changelog.html
+++ b/user_guide/changelog.html
@@ -64,7 +64,7 @@ SVN Revision: not currently released
Database
- Added ability to set additional database config values in DSN connections via the query string.
-
+
Libraries
@@ -85,6 +85,7 @@ SVN Revision: not currently released
- Amended fixes for bug (#3419) with parsing DSN database connections.
+ - Moved the _has_operators() function (#4535) into DB_driver from DB_active_rec.
- Fixed a syntax error in upload_lang.php.
- Fixed a bug (#4542) with a regular expression in the Image library.
--
cgit v1.2.3-24-g4f1b