forked from Cavemanon/cavepaintings
bool_escape('1') should be True
This commit is contained in:
@@ -490,7 +490,7 @@ function bool_escape($input): bool
|
||||
*/
|
||||
if (is_bool($input)) {
|
||||
return $input;
|
||||
} elseif (is_numeric($input)) {
|
||||
} elseif (is_int($input)) {
|
||||
return ($input === 1);
|
||||
} else {
|
||||
$value = filter_var($input, FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE);
|
||||
|
@@ -59,6 +59,9 @@ class PolyfillsTest extends \PHPUnit\Framework\TestCase
|
||||
|
||||
$this->assertTrue(bool_escape(1));
|
||||
$this->assertFalse(bool_escape(0));
|
||||
|
||||
$this->assertTrue(bool_escape("1"));
|
||||
$this->assertFalse(bool_escape("0"));
|
||||
}
|
||||
|
||||
public function test_clamp()
|
||||
|
Reference in New Issue
Block a user