From 9805f61a0aca60f3d01e89d1f3d66a2ce9ff3d83 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Mon, 31 Dec 2007 16:02:32 +0000 Subject: Fixed a bug in Validation where individual error messages for checkboxes wasn't supported. --- system/libraries/Validation.php | 10 ++++++++-- user_guide/changelog.html | 1 + 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/system/libraries/Validation.php b/system/libraries/Validation.php index 575c5262e..468f2ad4e 100644 --- a/system/libraries/Validation.php +++ b/system/libraries/Validation.php @@ -228,8 +228,14 @@ class CI_Validation { $line = $this->_error_messages['isset']; } - $field = ( ! isset($this->_fields[$field])) ? $field : $this->_fields[$field]; - $this->_error_array[] = sprintf($line, $field); + // Build the error message + $mfield = ( ! isset($this->_fields[$field])) ? $field : $this->_fields[$field]; + $message = sprintf($line, $mfield); + + // Set the error variable. Example: $this->username_error + $error = $field.'_error'; + $this->$error = $this->_error_prefix.$message.$this->_error_suffix; + $this->_error_array[] = $message; } continue; diff --git a/user_guide/changelog.html b/user_guide/changelog.html index d8bdc7996..152dd4812 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -92,6 +92,7 @@ Change Log
  • Fixed a bug in word_wrap() of the Text Helper that incorrectly referenced an object.
  • Fixed a bug in the Email library where some timezones were calculated incorrectly.
  • Fixed a bug in Validation where valid_ip() wasn't called properly.
  • +
  • Fixed a bug in Validation where individual error messages for checkboxes wasn't supported.
  • Fixed a bug in the Session library where user agent matching would fail on user agents ending with a space.
  • Fixed a bug in database driver where num_rows property wasn't getting updated.
  • Fixed a bug in captcha calling an invalid PHP function.
  • -- cgit v1.2.3-24-g4f1b