protected function isAllowed($_files_array = [], $_type = 'doc') { $check = true; $type = trim(strtolower($_type)); foreach ($_files_array as $file) { $file = (array) $file; $name = isset($file['filename']) ? $file['filename'] : $file['name']; if (trim($name) === '') { continue; } $ext = App\Upload::getExtensionFromFilename($name); if ($ext === '') { return false; } if ($type === 'doc') { if (!in_array($ext, $this->allowed_docs) && !in_array($ext, $this->allowed_images)) { return false; } } else { if (!in_array($ext, $this->allowed_images)) { return false; } } } return true; }