Procházet zdrojové kódy

修复设置多个文件上传表单并设置了required验证规则时无法编辑错误

jqh před 5 roky
rodič
revize
f4fb811103
1 změnil soubory, kde provedl 4 přidání a 0 odebrání
  1. 4 0
      src/Form/Field/File.php

+ 4 - 0
src/Form/Field/File.php

@@ -60,6 +60,10 @@ class File extends Field implements UploadFieldInterface
             return $this->validator->call($this, $input);
         }
 
+        if (! Arr::has($input, $this->column)) {
+            return false;
+        }
+
         $value = Arr::get($input, $this->column);
         $value = array_filter(is_array($value) ? $value : explode(',', $value));