Browse Source

Bail out early, an empty array is likely the most common case.

ndm2 6 years ago
parent
commit
cad586a514
1 changed files with 3 additions and 1 deletions
  1. 3 1
      src/Http/ServerRequest.php

+ 3 - 1
src/Http/ServerRequest.php

@@ -446,7 +446,9 @@ class ServerRequest implements ArrayAccess, ServerRequestInterface
      */
     protected function _processFiles($post, $files)
     {
-        if (!is_array($files)) {
+        if (empty($files) ||
+            !is_array($files)
+        ) {
             return $post;
         }
         $fileData = [];