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

Variable leaking out of foreach in withRules() #480

Closed
carlosvini opened this issue May 26, 2015 · 1 comment
Closed

Variable leaking out of foreach in withRules() #480

carlosvini opened this issue May 26, 2015 · 1 comment
Labels

Comments

@carlosvini
Copy link
Contributor

File https://github.com/formers/former/blob/master/src/Former/Former.php#L306
Around line 306

Variable $parameters is set inside an "if" but is not set in the next loop.

The HTML5 validation seems to work besides this. But when i use getRules() i get wrong rules.

To reproduce it use

 $form->rules(['age' => 'min:18', 'name' => 'required'])

Then call \Former::getRules('name') and you will get

array(1) { ["required"]=> array(1) { [0]=> string(2) "18" } }
@claar
Copy link
Member

claar commented May 26, 2015

Oops. Nice catch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants