diff --git a/system/Validation/FileRules.php b/system/Validation/FileRules.php index aec9d9efa2a4..ba054d134b6b 100644 --- a/system/Validation/FileRules.php +++ b/system/Validation/FileRules.php @@ -11,6 +11,7 @@ namespace CodeIgniter\Validation; +use CodeIgniter\HTTP\CLIRequest; use CodeIgniter\HTTP\IncomingRequest; use CodeIgniter\HTTP\Request; use CodeIgniter\HTTP\RequestInterface; @@ -39,7 +40,7 @@ public function __construct(?RequestInterface $request = null) $request = Services::request(); } - assert($request instanceof IncomingRequest); + assert($request instanceof IncomingRequest || $request instanceof CLIRequest); $this->request = $request; }