Skip to content

Commit e79e664

Browse files
committed
Fixing Issue #234
1 parent 2987dcd commit e79e664

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

lib/validator/sfValidatorBoolean.class.php

100644100755
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ class sfValidatorBoolean extends sfValidatorBase
3333
*/
3434
protected function configure($options = array(), $messages = array())
3535
{
36-
$this->addOption('true_values', array('true', 't', 'yes', 'y', 'on', '1'));
37-
$this->addOption('false_values', array('false', 'f', 'no', 'n', 'off', '0'));
36+
$this->addOption('true_values', array('true', 't', 'yes', 'y', 'on', '1', 1, true));
37+
$this->addOption('false_values', array('false', 'f', 'no', 'n', 'off', '0', 0, false));
3838

3939
$this->setOption('required', false);
4040
$this->setOption('empty_value', false);
@@ -45,12 +45,12 @@ protected function configure($options = array(), $messages = array())
4545
*/
4646
protected function doClean($value)
4747
{
48-
if (in_array($value, $this->getOption('true_values')))
48+
if (in_array($value, $this->getOption('true_values'), true))
4949
{
5050
return true;
5151
}
5252

53-
if (in_array($value, $this->getOption('false_values')))
53+
if (in_array($value, $this->getOption('false_values'), true))
5454
{
5555
return false;
5656
}

test/unit/validator/sfValidatorBooleanTest.php

100644100755
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
require_once(__DIR__.'/../../bootstrap/unit.php');
1212

13-
$t = new lime_test(17);
13+
$t = new lime_test(21);
1414

1515
$v = new sfValidatorBoolean();
1616

0 commit comments

Comments
 (0)