summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--system/libraries/Form_validation.php17
-rw-r--r--user_guide_src/source/changelog.rst2
2 files changed, 12 insertions, 7 deletions
diff --git a/system/libraries/Form_validation.php b/system/libraries/Form_validation.php
index 5663da981..918f6904c 100644
--- a/system/libraries/Form_validation.php
+++ b/system/libraries/Form_validation.php
@@ -5,9 +5,9 @@
* An open source application development framework for PHP 5.1.6 or newer
*
* NOTICE OF LICENSE
- *
+ *
* Licensed under the Open Software License version 3.0
- *
+ *
* This source file is subject to the Open Software License (OSL 3.0) that is
* bundled with this package in the files license.txt / license.rst. It is
* also available through the world wide web at this URL:
@@ -949,7 +949,7 @@ class CI_Form_validation {
return ($str !== $field) ? FALSE : TRUE;
}
-
+
// --------------------------------------------------------------------
/**
@@ -962,10 +962,13 @@ class CI_Form_validation {
*/
public function is_unique($str, $field)
{
- list($table, $field)=explode('.', $field);
- $query = $this->CI->db->limit(1)->get_where($table, array($field => $str));
-
- return $query->num_rows() === 0;
+ list($table, $field) = explode('.', $field);
+ if (isset($this->CI->db))
+ {
+ $query = $this->CI->db->limit(1)->get_where($table, array($field => $str));
+ return $query->num_rows() === 0;
+ }
+ return FALSE;
}
// --------------------------------------------------------------------
diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst
index 5c7fd8d59..a5407ee29 100644
--- a/user_guide_src/source/changelog.rst
+++ b/user_guide_src/source/changelog.rst
@@ -59,7 +59,9 @@ Bug fixes for 3.0
- Fixed a bug (#181) where a mis-spelling was in the form validation
language file.
- Fixed a bug (#159, #163) that mishandled Active Record nested transactions because _trans_depth was not getting incremented.
+- Fixed a bug (#737, #75) where pagination anchor class was not set properly when using initialize method.
- Bug #419 - auto_link() now recognizes URLs that come after a word boundary.
+- Bug #724 - is_unique in form validation now checks that you are connected to a database.
Version 2.1.0
=============