From: Tim Düsterhus Date: Thu, 18 Aug 2011 13:28:24 +0000 (+0200) Subject: Using PHP 5.3 closures instead of create_function X-Git-Tag: 2.0.0_Beta_1~1867^2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=01ac3eb27865351b46425b4f53fb75916d1b908c;p=GitHub%2FWoltLab%2FWCF.git Using PHP 5.3 closures instead of create_function --- diff --git a/wcfsetup/install/files/lib/util/StyleUtil.class.php b/wcfsetup/install/files/lib/util/StyleUtil.class.php index c689b3e75c..978ccd4b64 100644 --- a/wcfsetup/install/files/lib/util/StyleUtil.class.php +++ b/wcfsetup/install/files/lib/util/StyleUtil.class.php @@ -26,7 +26,9 @@ class StyleUtil { $contents = preg_replace('/background-position:\s*left/', 'wcf-background-position:left', $contents); $contents = preg_replace('/background-position:\s*right/', 'background-position:left', $contents); $contents = str_replace('wcf-background-position:left', 'background-position:right', $contents); - $contents = preg_replace_callback('/background-position:\s*([\d\.]+)%/', create_function('$matches', 'return "background-position:".(100.0-$matches[1])."%";'), $contents); + $contents = preg_replace_callback('/background-position:\s*([\d\.]+)%/', function ($matches) { + return 'background-position:'.(100.0-$matches[1]).'%'; + }, $contents); // background-image $contents = str_replace('-ltr', '-rtl', $contents);