diff --git a/inc/auth.php b/inc/auth.php index db53a4c1922bf6c0d364d9a3b5024869458139ec..63f84e141c154c8939a534bdb7ece57a7d0438a7 100644 --- a/inc/auth.php +++ b/inc/auth.php @@ -380,13 +380,20 @@ function auth_aclcheck($id,$user,$groups){ * @see rawurldecode() */ function auth_nameencode($name,$skip_group=false){ - if($skip_group && $name{0} =='@'){ - return '@'.preg_replace('/([\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f])/e', - "'%'.dechex(ord('\\1'))",substr($name,1)); - }else{ - return preg_replace('/([\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f])/e', - "'%'.dechex(ord('\\1'))",$name); + global $cache_authname; + $cache =& $cache_authname; + + if (!isset($cache[$name][$skip_group])) { + if($skip_group && $name{0} =='@'){ + $cache[$name][$skip_group] = '@'.preg_replace('/([\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f])/e', + "'%'.dechex(ord('\\1'))",substr($name,1)); + }else{ + $cache[$name][$skip_group] = preg_replace('/([\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f])/e', + "'%'.dechex(ord('\\1'))",$name); + } } + + return $cache[$name][$skip_group]; } /** diff --git a/inc/init.php b/inc/init.php index 2ba16c2c3ba750d90e2405fe9106f877f0349702..1b8f99825beaf78c472364c2efa33526d32a6e62 100644 --- a/inc/init.php +++ b/inc/init.php @@ -24,9 +24,10 @@ else { error_reporting(DOKU_E_LEVEL); } // init memory caches - global $cache_revinfo; $cache_revinfo = array(); - global $cache_wikifn; $cache_wikifn = array(); - global $cache_wikifn; $cache_cleanid = array(); + global $cache_revinfo; $cache_revinfo = array(); + global $cache_wikifn; $cache_wikifn = array(); + global $cache_cleanid; $cache_cleanid = array(); + global $cache_authname; $cache_authname = array(); //prepare config array() global $conf;