1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2025-09-10 17:49:38 +02:00

1) SMACK-170 - Added JID escaping capabilities to SMACK.

2) Escaping form field values to prevent bad xml.

git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@5363 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
Derek DeMoro 2006-09-14 15:19:39 +00:00 committed by derek
parent 1df8baa6f7
commit 85781a7158
8 changed files with 83 additions and 35 deletions

View file

@ -112,7 +112,7 @@ public abstract class Packet {
* value has not been set.
*/
public String getTo() {
return to;
return StringUtils.escapeJID(to);
}
/**
@ -134,7 +134,7 @@ public abstract class Packet {
* valud has not been set.
*/
public String getFrom() {
return from;
return StringUtils.escapeJID(from);
}
/**

View file

@ -198,7 +198,7 @@ public class RosterPacket extends IQ {
public String toXML() {
StringBuilder buf = new StringBuilder();
buf.append("<item jid=\"").append(user).append("\"");
buf.append("<item jid=\"").append(StringUtils.escapeJID(user)).append("\"");
if (name != null) {
buf.append(" name=\"").append(StringUtils.escapeForXML(name)).append("\"");
}