Permalink
Browse files

Fixed issue #113 - Input fields are automatically required

  • Loading branch information...
1 parent 12a1747 commit be66150e3e10b1b9ea8fd30cdb016536c146fffe @chrisberthe chrisberthe committed Oct 4, 2011
Showing with 2 additions and 1 deletion.
  1. +1 −1 system/libraries/Form_validation.php
  2. +1 −0 user_guide/changelog.html
@@ -485,7 +485,7 @@ protected function _execute($row, $rules, $postdata = NULL, $cycles = 0)
// If the field is blank, but NOT required, no further tests are necessary
$callback = FALSE;
- if ( ! in_array('required', $rules) AND is_null($postdata))
+ if ( ! in_array('required', $rules) AND empty($postdata))
{
// Before we bail out, does the rule contain a callback?
if (preg_match("/(callback_\w+(\[.*?\])?)/", implode(' ', $rules), $match))
@@ -140,6 +140,7 @@
<li>Fixed a bug (#89) - Fix a variable type mismatch in DB <samp>display_error()</samp> where an array is expected, but a string could be set instead.</li>
<li>Fixed a bug (#467) - Suppress warnings generated from get_magic_quotes_gpc() (deprecated in PHP 5.4)</li>
<li>Fixed a bug (#484) - First time _csrf_set_hash() is called, hash is never set to the cookie (in Security.php).</li>
+ <li>Fixed a bug (#113) - Input fields are automatically 'required' (in Form_validation.php).</li>
</ul>
<h2>Version 2.0.3</h2>

0 comments on commit be66150

Please sign in to comment.