summaryrefslogtreecommitdiffstats
path: root/system/libraries/Form_validation.php
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-03-20 14:48:00 +0100
committerAndrey Andreev <narf@bofh.bg>2012-03-20 14:48:00 +0100
commit31cf46eaec3b4613d5b46f9caed8bdd346b581cc (patch)
tree047b9d74def6254639b3d9b2833f36336dc99f8a /system/libraries/Form_validation.php
parentb68e70b2cd81f83fd038ca2c2d00fde210a8ee0e (diff)
parent733921ecc4da80f08a9d50ff0fb05bccf23de09d (diff)
Merge upstream branch
Diffstat (limited to 'system/libraries/Form_validation.php')
-rw-r--r--system/libraries/Form_validation.php26
1 files changed, 19 insertions, 7 deletions
diff --git a/system/libraries/Form_validation.php b/system/libraries/Form_validation.php
index 8a5d8eaa9..8a2793538 100644
--- a/system/libraries/Form_validation.php
+++ b/system/libraries/Form_validation.php
@@ -2,7 +2,7 @@
/**
* CodeIgniter
*
- * An open source application development framework for PHP 5.1.6 or newer
+ * An open source application development framework for PHP 5.2.4 or newer
*
* NOTICE OF LICENSE
*
@@ -51,6 +51,18 @@ class CI_Form_validation {
{
$this->CI =& get_instance();
+ // applies delimiters set in config file.
+ if (isset($rules['error_prefix']))
+ {
+ $this->_error_prefix = $rules['error_prefix'];
+ unset($rules['error_prefix']);
+ }
+ if (isset($rules['error_suffix']))
+ {
+ $this->_error_suffix = $rules['error_suffix'];
+ unset($rules['error_suffix']);
+ }
+
// Validation rules can be stored in a config file.
$this->_config_rules = $rules;
@@ -58,7 +70,7 @@ class CI_Form_validation {
$this->CI->load->helper('form');
// Set the character encoding in MB.
- if (function_exists('mb_internal_encoding'))
+ if (MB_ENABLED === TRUE)
{
mb_internal_encoding($this->CI->config->item('charset'));
}
@@ -87,7 +99,7 @@ class CI_Form_validation {
return $this;
}
- // If an array was passed via the first parameter instead of indidual string
+ // If an array was passed via the first parameter instead of individual string
// values we cycle through it and recursively call this function.
if (is_array($field))
{
@@ -925,7 +937,7 @@ class CI_Form_validation {
return FALSE;
}
- if (function_exists('mb_strlen'))
+ if (MB_ENABLED === TRUE)
{
return ! (mb_strlen($str) < $val);
}
@@ -949,7 +961,7 @@ class CI_Form_validation {
return FALSE;
}
- if (function_exists('mb_strlen'))
+ if (MB_ENABLED === TRUE)
{
return ! (mb_strlen($str) > $val);
}
@@ -973,7 +985,7 @@ class CI_Form_validation {
return FALSE;
}
- if (function_exists('mb_strlen'))
+ if (MB_ENABLED === TRUE)
{
return (mb_strlen($str) == $val);
}
@@ -1337,4 +1349,4 @@ class CI_Form_validation {
}
/* End of file Form_validation.php */
-/* Location: ./system/libraries/Form_validation.php */
+/* Location: ./system/libraries/Form_validation.php */ \ No newline at end of file