Commit 472e377b authored by Taylor Otwell's avatar Taylor Otwell

fix the validation of required file uploads.

parent dae28394
...@@ -223,6 +223,10 @@ class Validator { ...@@ -223,6 +223,10 @@ class Validator {
{ {
return false; return false;
} }
elseif ( ! is_null(Input::file($attribute)) and $value['tmp_name'] == '')
{
return false;
}
return true; return true;
} }
...@@ -502,7 +506,7 @@ class Validator { ...@@ -502,7 +506,7 @@ class Validator {
*/ */
protected function validate_mimes($attribute, $value, $parameters) protected function validate_mimes($attribute, $value, $parameters)
{ {
if (is_array($value) and ! isset($value['tmp_name'])) return true; if ( ! is_array($value) or Arr::get($value, 'tmp_name', '') == '') return true;
foreach ($parameters as $extension) foreach ($parameters as $extension)
{ {
......
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