mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Fix uploadError validation rule to work with OS Win. Here the error is string, not integer.
This commit is contained in:
parent
827dc77a11
commit
1725386c16
2 changed files with 3 additions and 1 deletions
|
@ -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')));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -964,7 +964,7 @@ class Validation {
|
|||
$check = $check['error'];
|
||||
}
|
||||
|
||||
return $check === UPLOAD_ERR_OK;
|
||||
return (int)$check === UPLOAD_ERR_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue