aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2013-12-16 02:04:16 +0000
committerMatthew Wild <mwild1@gmail.com>2013-12-16 02:04:16 +0000
commit077a959dbc316d125f047c28f6a5eb89569dcf07 (patch)
tree3fbbe3f3f815458324ce332aaf8fcdd0df642e45 /util
parent39d6068003836790e511e9f4df76ec2feb24d0ed (diff)
parent54824c98f10d8da89b2b2af3ab3c536e906d866d (diff)
downloadprosody-077a959dbc316d125f047c28f6a5eb89569dcf07.tar.gz
prosody-077a959dbc316d125f047c28f6a5eb89569dcf07.zip
Merge 0.9->0.10
Diffstat (limited to 'util')
-rw-r--r--util/jid.lua5
1 files changed, 4 insertions, 1 deletions
diff --git a/util/jid.lua b/util/jid.lua
index 0d9a864f..08e63335 100644
--- a/util/jid.lua
+++ b/util/jid.lua
@@ -8,7 +8,7 @@
-local match = string.match;
+local match, sub = string.match, string.sub;
local nodeprep = require "util.encodings".stringprep.nodeprep;
local nameprep = require "util.encodings".stringprep.nameprep;
local resourceprep = require "util.encodings".stringprep.resourceprep;
@@ -47,6 +47,9 @@ end
local function _prepped_split(jid)
local node, host, resource = _split(jid);
if host then
+ if sub(host, -1, -1) == "." then -- Strip empty root label
+ host = sub(host, 1, -2);
+ end
host = nameprep(host);
if not host then return; end
if node then