fix the validation of required file uploads.
This commit is contained in:
parent
dae283943f
commit
472e377b02
|
@ -223,6 +223,10 @@ protected function validate_required($attribute, $value)
|
|||
{
|
||||
return false;
|
||||
}
|
||||
elseif ( ! is_null(Input::file($attribute)) and $value['tmp_name'] == '')
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -502,7 +506,7 @@ protected function validate_alpha_dash($attribute, $value)
|
|||
*/
|
||||
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)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue