diff --git a/lib/Cake/Test/Case/Utility/ValidationTest.php b/lib/Cake/Test/Case/Utility/ValidationTest.php index cc60f7df9..aef449c74 100644 --- a/lib/Cake/Test/Case/Utility/ValidationTest.php +++ b/lib/Cake/Test/Case/Utility/ValidationTest.php @@ -2368,9 +2368,11 @@ class ValidationTest extends CakeTestCase { public function testUploadError() { $this->assertTrue(Validation::uploadError(0)); $this->assertTrue(Validation::uploadError(array('error' => 0))); + $this->assertTrue(Validation::uploadError(array('error' => '0'))); $this->assertFalse(Validation::uploadError(2)); $this->assertFalse(Validation::uploadError(array('error' => 2))); + $this->assertFalse(Validation::uploadError(array('error' => '2'))); } /** diff --git a/lib/Cake/Utility/Validation.php b/lib/Cake/Utility/Validation.php index e78a956cf..b990b6ca9 100644 --- a/lib/Cake/Utility/Validation.php +++ b/lib/Cake/Utility/Validation.php @@ -964,7 +964,7 @@ class Validation { $check = $check['error']; } - return $check === UPLOAD_ERR_OK; + return (int)$check === UPLOAD_ERR_OK; } /**