From 1e34820cd87837b545b310022ee460803d8c5b54 Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Sat, 16 Dec 2006 20:24:34 +0000 Subject: - Optimize acl_getf_global a bit - a little performance improvement of the IP regular expressions - convert post_text/subject collation to utf8_unicode_ci if a user wants to use mysql_fulltext to allow case insensitivity [Bug #6272] - mysql_fulltext should alter all necessary columns at once to speed up the process - validate URLs against RFC3986 - fixed some weirdness in make_clickable I hope I didn't break any URLs with this commit, if I did then report it to the bugtracker please! git-svn-id: file:///svn/phpbb/trunk@6774 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/auth.php | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'phpBB/includes/auth.php') diff --git a/phpBB/includes/auth.php b/phpBB/includes/auth.php index 70a3ccb046..a553d8e4ed 100644 --- a/phpBB/includes/auth.php +++ b/phpBB/includes/auth.php @@ -221,16 +221,18 @@ class auth */ function acl_getf_global($opt) { - $allowed = false; - if (is_array($opt)) { + // evaluates to true as soon as acl_getf_global is true for one option foreach ($opt as $check_option) { - $allowed |= $this->acl_getf_global($check_option); + if ($this->acl_getf_global($check_option)) + { + return true; + } } - return $allowed; + return false; } if (isset($this->acl_options['local'][$opt])) @@ -243,20 +245,19 @@ class auth continue; } - $allowed = (!isset($this->cache[$f][$opt])) ? $this->acl_get($opt, $f) : $this->cache[$f][$opt]; - - if ($allowed) + // as soon as the user has any permission we're done so return true + if ((!isset($this->cache[$f][$opt])) ? $this->acl_get($opt, $f) : $this->cache[$f][$opt]) { - break; + return true; } } } else if (isset($this->acl_options['global'][$opt])) { - $allowed = $this->acl_get($opt); + return $this->acl_get($opt); } - return $allowed; + return false; } /** -- cgit v1.2.1