Fix #427 #737

Merged
merged 1 commit into from Dec 14, 2012

Conversation

Projects
None yet
2 participants
@jails
Contributor

jails commented Dec 13, 2012

The main problem here concern the empty string '' which match indifferently 0 or '0' due to PHP's casting.
This PR take this specific case into account to avoid matching issue with this specific value.

However other casting issues are left to the user e.g.:

$this->assertTrue(Validator::isInList('0', null, array('list' => array(true, false)))); //Pass
$this->assertTrue(Validator::isInList('1', null, array('list' => array(true, false)))); //Pass
$this->assertTrue(Validator::isInList('Gwoo lent his boat in exchange of beer', null, array('list' => array(true, false)))); //Pass

nateabele added a commit that referenced this pull request Dec 14, 2012

@nateabele nateabele merged commit 62b8b7a into UnionOfRAD:dev Dec 14, 2012

1 check passed

default The Travis build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment