From 247a7a8182f69c47a9257490aae76a1633f319f8 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Tue, 17 Jan 2006 18:09:00 +0000 Subject: [PATCH] move around - better not call create_function in a loop git-svn-id: file:///svn/phpbb/trunk@5469 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/auth.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/phpBB/includes/auth.php b/phpBB/includes/auth.php index 98aae0236b..123180f081 100644 --- a/phpBB/includes/auth.php +++ b/phpBB/includes/auth.php @@ -616,6 +616,7 @@ class auth_admin extends auth break; + // Global Moderator Permission Mask case 'mod_global': if ($group_id === false && $user_id === false) @@ -630,6 +631,7 @@ class auth_admin extends auth break; + // Moderator Permission Mask case 'mod_local': if ($forum_id === false && ($group_id === false || $user_id === false)) @@ -676,6 +678,9 @@ class auth_admin extends auth $compare_options = array_combine($compare_options, array_fill(1, sizeof($compare_options), 0)); } + // Defining the user-function here to save some memory + $return_zero = create_function('$value', 'return 0;'); + // Actually fill the gaps if (sizeof($hold_ary)) { @@ -688,7 +693,7 @@ class auth_admin extends auth // The differences get merged into $hold_ary (all permissions having ACL_NO set) $hold_ary[$ug_id][$id] = array_merge($options, - array_map(create_function('$value', 'return 0;'), + array_map($return_zero, array_flip( array_diff( array_keys($compare_options), array_keys($options) @@ -813,6 +818,7 @@ class auth_admin extends auth return true; } + } ?> \ No newline at end of file