diff options
author | Phil Sturgeon <email@philsturgeon.co.uk> | 2011-07-16 03:37:31 +0200 |
---|---|---|
committer | Phil Sturgeon <email@philsturgeon.co.uk> | 2011-07-16 03:37:31 +0200 |
commit | 1b1b67693060ecb6dd399ea6aee4a5503d96adda (patch) | |
tree | 1f3832cb7c748d700a04d0be94416d60b566c57d | |
parent | 8a02247acbac87b3b947d9188ec4f5805f2e1a52 (diff) |
enable use of param in a callback rule, on behalf of marcoscoelho.
-rw-r--r-- | system/libraries/Form_validation.php | 2 | ||||
-rw-r--r-- | user_guide/changelog.html | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/system/libraries/Form_validation.php b/system/libraries/Form_validation.php index d370d75ee..fd95d76fa 100644 --- a/system/libraries/Form_validation.php +++ b/system/libraries/Form_validation.php @@ -488,7 +488,7 @@ class CI_Form_validation { if ( ! in_array('required', $rules) AND is_null($postdata)) { // 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)) { $callback = TRUE; $rules = (array('1' => $match[1])); diff --git a/user_guide/changelog.html b/user_guide/changelog.html index a924edc9c..8a6fea748 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -75,6 +75,7 @@ Change Log <li>Removed internal usage of the <samp>EXT</samp> constant.</li> <li>Visual updates to the welcome_message view file and default error templates. Thanks to <a href="https://bitbucket.org/danijelb">danijelb</a> for the pull request.</li> <li>Added <samp>insert_batch()</samp> function to the PostgreSQL database driver. Thanks to epallerols for the patch.</li> + <li class="reactor">Callback validation rules can now accept parameters like any other validation rule.</li> </ul> </li> <li>Helpers |