diff options
author | Daniel Gultsch <daniel@gultsch.de> | 2015-05-20 03:39:58 +0200 |
---|---|---|
committer | Daniel Gultsch <daniel@gultsch.de> | 2015-05-20 03:39:58 +0200 |
commit | 4f36aa39a4e8aa5128c12a713bd9d3d4d9b51469 (patch) | |
tree | 1a87a4e98b88f4e0eb3fc36bcee74f403acf0abe /src/main/java/eu/siacs/conversations/xmpp/jid | |
parent | fbf81f59dbc17951faea945cca979312201d00fe (diff) | |
parent | 7824c01748a89688c5f76307cc1f4221a9e2ffb5 (diff) |
Merge branch 'development'
Diffstat (limited to 'src/main/java/eu/siacs/conversations/xmpp/jid')
-rw-r--r-- | src/main/java/eu/siacs/conversations/xmpp/jid/Jid.java | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/main/java/eu/siacs/conversations/xmpp/jid/Jid.java b/src/main/java/eu/siacs/conversations/xmpp/jid/Jid.java index 295e067a..f989c0c2 100644 --- a/src/main/java/eu/siacs/conversations/xmpp/jid/Jid.java +++ b/src/main/java/eu/siacs/conversations/xmpp/jid/Jid.java @@ -130,12 +130,19 @@ public final class Jid { if (resourcepart.isEmpty() || resourcepart.length() > 1023) { throw new InvalidJidException(InvalidJidException.INVALID_PART_LENGTH); } - dp = IDN.toUnicode(jid.substring(domainpartStart, slashLoc), IDN.USE_STD3_ASCII_RULES); + try { + dp = IDN.toUnicode(Stringprep.nameprep(jid.substring(domainpartStart, slashLoc)), IDN.USE_STD3_ASCII_RULES); + } catch (final StringprepException e) { + throw new InvalidJidException(InvalidJidException.STRINGPREP_FAIL, e); + } finaljid = finaljid + dp + "/" + rp; } else { resourcepart = ""; - dp = IDN.toUnicode(jid.substring(domainpartStart, jid.length()), - IDN.USE_STD3_ASCII_RULES); + try{ + dp = IDN.toUnicode(Stringprep.nameprep(jid.substring(domainpartStart, jid.length())), IDN.USE_STD3_ASCII_RULES); + } catch (final StringprepException e) { + throw new InvalidJidException(InvalidJidException.STRINGPREP_FAIL, e); + } finaljid = finaljid + dp; } |