Commit 9f78c8be authored by Taylor Otwell's avatar Taylor Otwell

Fix bug in validate_mimes method.

parent e89fd04a
......@@ -447,7 +447,7 @@ class Validator {
*/
protected function validate_image($attribute, $value)
{
return $this->validate_mimes($attribute, array('jpg', 'png', 'gif', 'bmp'));
return $this->validate_mimes($attribute, $value, array('jpg', 'png', 'gif', 'bmp'));
}
/**
......@@ -490,14 +490,17 @@ class Validator {
* Validate the MIME type of a file upload attribute is in a set of MIME types.
*
* @param string $attribute
* @param array $value
* @param array $parameters
* @return bool
*/
protected function validate_mimes($attribute, $parameters)
protected function validate_mimes($attribute, $value, $parameters)
{
if (is_array($value) and ! isset($value['tmp_name'])) return true;
foreach ($parameters as $extension)
{
if (File::is($extension, $this->attributes[$attribute]['tmp_name']))
if (File::is($extension, $value['tmp_name']))
{
return true;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment