diff --git a/lib/Cake/Test/Case/Utility/ValidationTest.php b/lib/Cake/Test/Case/Utility/ValidationTest.php index 0d0c94712..02cda1dc4 100644 --- a/lib/Cake/Test/Case/Utility/ValidationTest.php +++ b/lib/Cake/Test/Case/Utility/ValidationTest.php @@ -2362,8 +2362,8 @@ class ValidationTest extends CakeTestCase { $this->assertTrue(Validation::mimeType($image, array('image/gif'))); $this->assertTrue(Validation::mimeType(array('tmp_name' => $image), array('image/gif'))); $this->assertTrue(Validation::mimeType(array('tmp_name' => $image), '#image/.+#')); + $this->assertTrue(Validation::mimeType($image, array('image/GIF'))); - $this->assertFalse(Validation::mimeType($image, array('image/GIF'))); $this->assertFalse(Validation::mimeType($image, array('image/png'))); $this->assertFalse(Validation::mimeType(array('tmp_name' => $image), array('image/png'))); } diff --git a/lib/Cake/Utility/Validation.php b/lib/Cake/Utility/Validation.php index daf3d5fd5..b15e00c0d 100644 --- a/lib/Cake/Utility/Validation.php +++ b/lib/Cake/Utility/Validation.php @@ -948,6 +948,9 @@ class Validation { return self::_check($mime, $mimeTypes); } + foreach ($mimeTypes as $key => $val) { + $mimeTypes[$key] = strtolower($val); + } return in_array($mime, $mimeTypes); }