From 1f5b298edb9216c9718d91104895e22797c5309c Mon Sep 17 00:00:00 2001 From: Seamus Lee Date: Thu, 2 Feb 2023 12:41:08 +1100 Subject: [PATCH] [REF] Use Civi::statics in CRM_Utils_File instead of php static --- CRM/Utils/File.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CRM/Utils/File.php b/CRM/Utils/File.php index bc882aa8f44f..b9355b14c8f4 100644 --- a/CRM/Utils/File.php +++ b/CRM/Utils/File.php @@ -352,8 +352,7 @@ public static function stripComments($string) { * @return bool */ public static function isExtensionSafe($ext) { - static $extensions = NULL; - if (!$extensions) { + if (!isset(Civi::$statics[__CLASS__]['file_extensions'])) { $extensions = CRM_Core_OptionGroup::values('safe_file_extension', TRUE); // make extensions to lowercase @@ -370,9 +369,10 @@ public static function isExtensionSafe($ext) { unset($extensions['html']); unset($extensions['htm']); } + Civi::$statics[__CLASS__]['file_extensions'] = $extensions; } // support lower and uppercase file extensions - return (bool) isset($extensions[strtolower($ext)]); + return (bool) isset(Civi::$statics[__CLASS__]['file_extensions'][strtolower($ext)]); } /**