Skip to content

Commit a38381f

Browse files
committed
Revise the fix to avoid the BC break
1 parent 5d17445 commit a38381f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/validator/sfValidatorBoolean.class.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,13 @@ protected function configure($options = array(), $messages = array())
4545
*/
4646
protected function doClean($value)
4747
{
48-
$stringValue = $value !== false ? (string) $value : '0';
49-
if (in_array($stringValue, $this->getOption('true_values')))
48+
$checkValue = $value === 0 ? '0' : $value;
49+
if (in_array($checkValue, $this->getOption('true_values')))
5050
{
5151
return true;
5252
}
5353

54-
if (in_array($stringValue, $this->getOption('false_values')))
54+
if (in_array($checkValue, $this->getOption('false_values')))
5555
{
5656
return false;
5757
}

0 commit comments

Comments
 (0)