From 654591c83be5744a0218b7a6ec753da78d3ccb23 Mon Sep 17 00:00:00 2001 From: Raam Dev Date: Sun, 25 Feb 2018 16:19:25 -0500 Subject: [PATCH] Replace deprecated create_function() with Closures create_function() has been deprecated as of PHP 7.2 Occurrences of create_function() in /plugin.php were intentionally excluded from this update as that source code is run when PHP < 5.4 is detected (Closures require PHP 5.4+). See websharks/comet-cache#921 --- src/includes/traits/Shared/FsUtils.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/includes/traits/Shared/FsUtils.php b/src/includes/traits/Shared/FsUtils.php index 6785320b..696ac444 100644 --- a/src/includes/traits/Shared/FsUtils.php +++ b/src/includes/traits/Shared/FsUtils.php @@ -30,7 +30,7 @@ public function nDirSeps($dir_file, $allow_trailing_slash = false) } if (mb_strpos($dir_file, ':' !== false)) { if (preg_match('/^(?P[a-zA-Z])\:[\/\\\\]/u', $dir_file)) { - $dir_file = preg_replace_callback('/^(?P[a-zA-Z])\:[\/\\\\]/u', create_function('$m', 'return mb_strtoupper($m[0]);'), $dir_file); + $dir_file = preg_replace_callback('/^(?P[a-zA-Z])\:[\/\\\\]/u', function ($m) { return mb_strtoupper($m[0]); }, $dir_file); } } $dir_file = preg_replace('/\/+/u', '/', str_replace([DIRECTORY_SEPARATOR, '\\', '/'], '/', $dir_file));