Skip to content
Permalink
Browse files

Fix uploadError validation rule to work with OS Win. Here the error i…

…s string, not integer.
  • Loading branch information...
dereuromark committed Feb 12, 2014
1 parent 827dc77 commit 1725386c16c1d4f272d1e8bd4a374bdf0f49fb82
Showing with 3 additions and 1 deletion.
  1. +2 −0 lib/Cake/Test/Case/Utility/ValidationTest.php
  2. +1 −1 lib/Cake/Utility/Validation.php
@@ -2368,9 +2368,11 @@ public function testMimeTypeFalse() {
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')));
}
/**
@@ -964,7 +964,7 @@ public static function uploadError($check) {
$check = $check['error'];
}
return $check === UPLOAD_ERR_OK;
return (int)$check === UPLOAD_ERR_OK;
}
/**

0 comments on commit 1725386

Please sign in to comment.
You can’t perform that action at this time.