Skip to content
Snippets Groups Projects
Unverified Commit aa19346c authored by DaveD's avatar DaveD Committed by GitHub
Browse files

Merge pull request #25498 from seamuslee001/5.59

[REF] Use Civi::statics in CRM_Utils_File instead of php static
parents 652617f4 1f5b298e
Branches
Tags
No related merge requests found
......@@ -352,8 +352,7 @@ class CRM_Utils_File {
* @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 @@ class CRM_Utils_File {
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)]);
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment