Using PHP 5.3 closures instead of create_function
authorTim Düsterhus <timwolla@arcor.de>
Thu, 18 Aug 2011 13:28:24 +0000 (15:28 +0200)
committerTim Düsterhus <timwolla@arcor.de>
Thu, 18 Aug 2011 13:28:24 +0000 (15:28 +0200)
wcfsetup/install/files/lib/util/StyleUtil.class.php

index c689b3e75cd7ff0777434d2aa53399da19d795dc..978ccd4b64590037b0ed11c1fe70c55da8c0e709 100644 (file)
@@ -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);