Commit 2f5f68e1 authored by Daniel Henninger's avatar Daniel Henninger Committed by dhenninger

Escaping JIDs before using them for presence broadcast, to handle jids with...

Escaping JIDs before using them for presence broadcast, to handle jids with spaces in them as pulled from provider.

git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/trunk@10799 b35dd754-fafc-0310-a699-88a17e54d16e
parent 14df7a18
......@@ -1875,6 +1875,10 @@ public class LdapManager {
return dnValue;
}
if (dnPattern == null) {
dnPattern = Pattern.compile("([^\\\\]=)([^\"]*?[^\\\\])(,|$)");
}
Matcher matcher = dnPattern.matcher(dnValue);
dnValue = matcher.replaceAll("$1\"$2\"$3");
dnValue = dnValue.replace("\\,", ",");
......@@ -1883,6 +1887,6 @@ public class LdapManager {
}
// Set the pattern to use to wrap DN values with "
private static Pattern dnPattern = Pattern.compile("([^\\\\]=)([^\"]*?[^\\\\])(,|$)");
private static Pattern dnPattern;
}
\ No newline at end of file
......@@ -596,6 +596,13 @@ public class Roster implements Cacheable, Externalizable {
}
// Broadcast presence to shared contacts whose subscription status is FROM
for (String contact : implicitFrom.keySet()) {
if (contact.contains("@")) {
String node = contact.substring(0, contact.lastIndexOf("@"));
String domain = contact.substring(contact.lastIndexOf("@")+1);
node = JID.escapeNode(node);
contact = new JID(node, domain, null).toBareJID();
}
packet.setTo(contact);
if (list != null && list.shouldBlockPacket(packet)) {
// Outgoing presence notifications are blocked for this contact
......
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