mirror of
https://github.com/yiisoft/yii2.git
synced 2025-10-29 09:28:37 +08:00
Fix #20492: Fix deprecation of finfo_close() in PHP 8.5 by conditionally closing the resource
This commit is contained in:
@ -171,7 +171,11 @@ class BaseFileHelper
|
||||
|
||||
if ($info) {
|
||||
$result = finfo_file($info, $file);
|
||||
finfo_close($info);
|
||||
// @link https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_finfo_close
|
||||
// @link https://github.com/php/php-src/commit/ccb716dcadf60d989db48e4d2963e14d7dc63df3
|
||||
if (PHP_VERSION_ID < 80500) {
|
||||
finfo_close($info);
|
||||
}
|
||||
|
||||
if ($result !== false) {
|
||||
return $result;
|
||||
|
||||
Reference in New Issue
Block a user