Skip to content

Commit 8a05f42

Browse files
committed
finfo_close() deprecated in PHP 8.5+
Fixes #98. Thanks, phiw13
1 parent afaeffd commit 8a05f42

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

com_connect.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1641,7 +1641,10 @@ function com_connect_file($atts)
16411641
if (class_exists('finfo') && !empty($fileInfo['tmp_name']) && $acceptableMime) {
16421642
$finfo = finfo_open(FILEINFO_MIME_TYPE);
16431643
$mtype = finfo_file($finfo, $fileInfo['tmp_name']);
1644-
finfo_close($finfo);
1644+
1645+
if (version_compare(PHP_VERSION, '8.5.0') < 0) {
1646+
finfo_close($finfo);
1647+
}
16451648

16461649
$mimeOK = com_connect_strposa($acceptableMime, $mtype);
16471650
} else {

0 commit comments

Comments
 (0)