Replace array_walk with array_map in 512b71762e
authorMatthias Schmidt <gravatronics@live.com>
Fri, 22 May 2015 16:44:10 +0000 (18:44 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Fri, 22 May 2015 16:44:10 +0000 (18:44 +0200)
wcfsetup/install/files/lib/system/cache/builder/TemplateListenerCodeCacheBuilder.class.php

index 185049c890b09604c6ac6b9d2daaf9b0514efc51..81bff15522702aee9dfee71e8cd4124978fe5200 100644 (file)
@@ -39,18 +39,18 @@ class TemplateListenerCodeCacheBuilder extends AbstractCacheBuilder {
                                if ($templateListener->options) {
                                        $options = explode(',', strtoupper($templateListener->options));
                                        
-                                       array_walk($options, function(&$value, $key) {
-                                               $value = "('".$value."'|defined && '".$value."'|constant)";
-                                       });
+                                       $options = array_map(function($value) {
+                                               return "('".$value."'|defined && '".$value."'|constant)";
+                                       }, $options);
                                        
                                        $templateCode .= '('.implode(' || ', $options).')';
                                }
                                if ($templateListener->permissions) {
                                        $permissions = explode(',', $templateListener->permissions);
                                        
-                                       array_walk($permissions, function(&$value, $key) {
-                                               $value = "\$__wcf->session->getPermission('".$value."')";
-                                       });
+                                       $permissions = array_map(function($value) {
+                                               return "\$__wcf->session->getPermission('".$value."')";
+                                       }, $permissions);
                                        
                                        if (!empty($options)) {
                                                $templateCode .= " && ";