Skip to content

Commit

Permalink
Fixed issue #113 - Input fields are automatically required
Browse files Browse the repository at this point in the history
  • Loading branch information
bertiful committed Oct 4, 2011
1 parent 12a1747 commit be66150
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion system/libraries/Form_validation.php
Expand Up @@ -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 // If the field is blank, but NOT required, no further tests are necessary
$callback = FALSE; $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? // Before we bail out, does the rule contain a callback?
if (preg_match("/(callback_\w+(\[.*?\])?)/", implode(' ', $rules), $match)) if (preg_match("/(callback_\w+(\[.*?\])?)/", implode(' ', $rules), $match))
Expand Down
1 change: 1 addition & 0 deletions user_guide/changelog.html
Expand Up @@ -140,6 +140,7 @@ <h3>Bug fixes for 2.1.0</h3>
<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 (#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 (#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 (#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> </ul>


<h2>Version 2.0.3</h2> <h2>Version 2.0.3</h2>
Expand Down

0 comments on commit be66150

Please sign in to comment.