Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

…s string, not integer.
  • Loading branch information...
commit 1725386c16c1d4f272d1e8bd4a374bdf0f49fb82 1 parent 827dc77
@dereuromark dereuromark authored
View
2  lib/Cake/Test/Case/Utility/ValidationTest.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')));
}
/**
View
2  lib/Cake/Utility/Validation.php
@@ -964,7 +964,7 @@ public static function uploadError($check) {
$check = $check['error'];
}
- return $check === UPLOAD_ERR_OK;
+ return (int)$check === UPLOAD_ERR_OK;
}
/**
Please sign in to comment.
Something went wrong with that request. Please try again.