summaryrefslogtreecommitdiffstats
path: root/system/libraries
diff options
context:
space:
mode:
authorEric Barnes <eric@ericlbarnes.com>2011-12-04 16:31:10 +0100
committerEric Barnes <eric@ericlbarnes.com>2011-12-04 16:31:10 +0100
commit180046646700ad869b8f8b8798321b4f8e4105c6 (patch)
tree06709261dc1c0778922a32f5ed73693ea28f6780 /system/libraries
parent1d861530da2d598f14c16c68461d83cd5c25bdf6 (diff)
parent2a3b40d6eff1600e3b70d9a8b6bb35a91dc847d6 (diff)
Merge branch 'develop' of github.com:EllisLab/CodeIgniter into develop
Diffstat (limited to 'system/libraries')
-rw-r--r--system/libraries/Form_validation.php17
1 files changed, 10 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;
}
// --------------------------------------------------------------------