Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow can_be_empty to be set on a per-field basis. This is useful for CSRF. #194

Merged
merged 1 commit into from Apr 28, 2013

Conversation

shadlaws
Copy link
Collaborator

Example:

$form->add("csrf", "input|hidden", Access::csrf_token(), array("can_be_empty" => true));
$form->csrf->add_rule(array("Access::verify_csrf", array(":value")));

If no CSRF token is returned in $_POST (illegal access), then load() will keep the pre-filled value in the form (legal access) unless we set can_be_empty to true.

shadlaws added a commit that referenced this pull request Apr 28, 2013
Allow can_be_empty to be set on a per-field basis. This is useful for CSRF.
@shadlaws shadlaws merged commit d0209f9 into bmidget:master Apr 28, 2013
@shadlaws shadlaws deleted the can_be_empty_patch branch April 28, 2013 21:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant