Commit 2c5e7ab1 authored by Günther Niess's avatar Günther Niess Committed by niess

OF-63: Fix for username with spaces

git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/trunk@11476 b35dd754-fafc-0310-a699-88a17e54d16e
parent 6209f835
......@@ -57,16 +57,20 @@
if (userJID == null) {
errors.put("userJID","userJID");
}
else if (userJID.indexOf('@') == -1) {
userJID = webManager.getXMPPServer().createJID(userJID, null).toBareJID();
}
if (errors.size() == 0) {
try {
// Escape username
String username = JID.escapeNode(userJID.substring(0, userJID.indexOf('@')));
String rest = userJID.substring(userJID.indexOf('@'), userJID.length());
userJID = username + rest;
if (userJID.indexOf('@') == -1) {
String username = JID.escapeNode(userJID);
String domain = webManager.getXMPPServer().getServerInfo().getXMPPDomain();
userJID = username + '@' + domain;
}
else {
String username = JID.escapeNode(userJID.substring(0, userJID.indexOf('@')));
String rest = userJID.substring(userJID.indexOf('@'), userJID.length());
userJID = username + rest;
}
IQ iq = new IQ(IQ.Type.set);
if ("owner".equals(affiliation) || "admin".equals(affiliation)) {
Element frag = iq.setChildElement("query", "http://jabber.org/protocol/muc#owner");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment