mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2025-09-11 19:29:41 +02:00
Escapes invalid charactes of the "to" and "from" fields in #toXML. SMACK-135
git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@2315 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
parent
5fdc96acab
commit
7905307d5f
3 changed files with 10 additions and 6 deletions
|
@ -52,6 +52,8 @@
|
|||
|
||||
package org.jivesoftware.smack.packet;
|
||||
|
||||
import org.jivesoftware.smack.util.StringUtils;
|
||||
|
||||
/**
|
||||
* Represents XMPP presence packets. Every presence packet has a type, which is one of
|
||||
* the following values:
|
||||
|
@ -199,10 +201,10 @@ public class Presence extends Packet {
|
|||
buf.append(" id=\"").append(getPacketID()).append("\"");
|
||||
}
|
||||
if (getTo() != null) {
|
||||
buf.append(" to=\"").append(getTo()).append("\"");
|
||||
buf.append(" to=\"").append(StringUtils.escapeForXML(getTo())).append("\"");
|
||||
}
|
||||
if (getFrom() != null) {
|
||||
buf.append(" from=\"").append(getFrom()).append("\"");
|
||||
buf.append(" from=\"").append(StringUtils.escapeForXML(getFrom())).append("\"");
|
||||
}
|
||||
if (type != Type.AVAILABLE) {
|
||||
buf.append(" type=\"").append(type).append("\"");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue