summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Smith <chris@jalakai.co.uk>2013-10-16 15:22:58 +0100
committerChristopher Smith <chris@jalakai.co.uk>2013-10-16 15:22:58 +0100
commit30f6faf00624251f7ac69fc86e9f3c5a01ad5d90 (patch)
tree10debb40f0f03aef54a3392b91b98713d79a40c0
parent74ed54d4f9a7c9796916f33f649ef94619a31704 (diff)
downloadrpg-30f6faf00624251f7ac69fc86e9f3c5a01ad5d90.tar.gz
rpg-30f6faf00624251f7ac69fc86e9f3c5a01ad5d90.tar.bz2
update for deprecated '/e' flag in preg_replace (php 5.5)
-rw-r--r--inc/auth.php16
1 files changed, 10 insertions, 6 deletions
diff --git a/inc/auth.php b/inc/auth.php
index 36fc7d086..ac079c574 100644
--- a/inc/auth.php
+++ b/inc/auth.php
@@ -808,14 +808,14 @@ function auth_nameencode($name, $skip_group = false) {
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(substr('\\1',-1)))", substr($name, 1)
+ $cache[$name][$skip_group] = '@'.preg_replace_callback(
+ '/([\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f])/',
+ 'auth_nameencode_callback', substr($name, 1)
);
} else {
- $cache[$name][$skip_group] = preg_replace(
- '/([\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f])/e',
- "'%'.dechex(ord(substr('\\1',-1)))", $name
+ $cache[$name][$skip_group] = preg_replace_callback(
+ '/([\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f])/',
+ 'auth_nameencode_callback', $name
);
}
}
@@ -823,6 +823,10 @@ function auth_nameencode($name, $skip_group = false) {
return $cache[$name][$skip_group];
}
+function auth_nameencode_callback($matches) {
+ return '%'.dechex(ord(substr($matches[1],-1)));
+}
+
/**
* Create a pronouncable password
*