Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Jan 8, 2020. It is now read-only.

Digit filter should ignore boolean input#6277

Merged
Ocramius merged 2 commits into
zendframework:developfrom
dstockto:digitFilterBoolean
May 20, 2014
Merged

Digit filter should ignore boolean input#6277
Ocramius merged 2 commits into
zendframework:developfrom
dstockto:digitFilterBoolean

Conversation

@dstockto
Copy link
Copy Markdown

The digits filter should only be filtering things that can represent digits. Booleans do not represent digits and should pass through unchanged.

Comment thread library/Zend/Filter/Digits.php Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As noted in our IRC conversation yesterday, I'd argue that if $value is an integer, you should do a return (string) $value;, and skip the regex. Integers are always series of digits; the main thing is ensuring that a string value is returned in that case, so that subsequent filters can operate on it.

@Ocramius Ocramius self-assigned this May 20, 2014
@Ocramius Ocramius added this to the 2.3.2 milestone May 20, 2014
@Ocramius Ocramius merged commit ec6dfa9 into zendframework:develop May 20, 2014
Ocramius added a commit that referenced this pull request May 20, 2014
@Ocramius
Copy link
Copy Markdown
Member

Merged manually into master via cherry-pick.

gianarb pushed a commit to zendframework/zend-filter that referenced this pull request May 15, 2015
gianarb pushed a commit to zendframework/zend-filter that referenced this pull request May 15, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants