From 52e2fe01d2819110162b154b2785df88149f3a3b Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 20 Dec 2021 16:21:22 +0200 Subject: finfo_open() returns an finfo object instead of resource in PHP 8.1 --- system/libraries/Upload.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/libraries/Upload.php') diff --git a/system/libraries/Upload.php b/system/libraries/Upload.php index ae60f35af..e754205de 100644 --- a/system/libraries/Upload.php +++ b/system/libraries/Upload.php @@ -1227,7 +1227,7 @@ class CI_Upload { if (function_exists('finfo_file')) { $finfo = @finfo_open(FILEINFO_MIME); - if (is_resource($finfo)) // It is possible that a FALSE value is returned, if there is no magic MIME database file found on the system + if ($finfo !== FALSE) // It is possible that a FALSE value is returned, if there is no magic MIME database file found on the system { $mime = @finfo_file($finfo, $file['tmp_name']); finfo_close($finfo); -- cgit v1.2.3-24-g4f1b