diff options
author | Christoph Burschka | 2015-03-27 17:24:13 +0100 |
---|---|---|
committer | Christoph Burschka | 2015-03-27 17:24:13 +0100 |
commit | c70517ea29faef059ab9aab643cea630214aa8a8 (patch) | |
tree | 8ce02367a479e0a882e39b1ba8c1c97a71894fa2 /core | |
parent | Use more inline code tags in README (diff) | |
download | ejabberd-auth-php-c70517ea29faef059ab9aab643cea630214aa8a8.tar.gz |
Fix #11: Revert escape sequences in XMPP node names.
Diffstat (limited to 'core')
-rw-r--r-- | core/EjabberdAuth.php | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/core/EjabberdAuth.php b/core/EjabberdAuth.php index 7817d64..c9b5ec4 100644 --- a/core/EjabberdAuth.php +++ b/core/EjabberdAuth.php @@ -63,6 +63,7 @@ class EjabberdAuth { function execute($data) { $args = explode(':', $data . ':::'); list($command, $username, $server, $password) = $args; + $username = xmpp_unescape_node($username); // Don't log the password, obviously. $this->log("Executing $command on {$username}@{$server}"); @@ -84,3 +85,10 @@ class EjabberdAuth { } } } + +function xmpp_unescape_node($string) { + return str_replace( + ['\\20', '\\22', '\\26', '\\27', '\\2f', '\\3a', '\\3c', '\\3e', '\\40', '\\5c'], + [' ', '"', '&', '\'', '/', ':', '<', '>', '@', '\\'], + $string); +} |