mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2024-11-22 22:32:06 +01:00
Escape nickname in Nick.toXML()
This commit is contained in:
parent
00ce194109
commit
c053f5a41b
1 changed files with 7 additions and 7 deletions
|
@ -20,6 +20,7 @@ import java.io.IOException;
|
||||||
|
|
||||||
import org.jivesoftware.smack.packet.ExtensionElement;
|
import org.jivesoftware.smack.packet.ExtensionElement;
|
||||||
import org.jivesoftware.smack.provider.ExtensionElementProvider;
|
import org.jivesoftware.smack.provider.ExtensionElementProvider;
|
||||||
|
import org.jivesoftware.smack.util.XmlStringBuilder;
|
||||||
|
|
||||||
import org.xmlpull.v1.XmlPullParser;
|
import org.xmlpull.v1.XmlPullParser;
|
||||||
import org.xmlpull.v1.XmlPullParserException;
|
import org.xmlpull.v1.XmlPullParserException;
|
||||||
|
@ -87,15 +88,14 @@ public class Nick implements ExtensionElement {
|
||||||
* @see org.jivesoftware.smack.packet.PacketExtension#toXML()
|
* @see org.jivesoftware.smack.packet.PacketExtension#toXML()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public String toXML(String enclosingNamespace) {
|
public XmlStringBuilder toXML(String enclosingNamespace) {
|
||||||
final StringBuilder buf = new StringBuilder();
|
XmlStringBuilder xml = new XmlStringBuilder(this, enclosingNamespace);
|
||||||
|
xml.rightAngleBracket();
|
||||||
|
|
||||||
buf.append('<').append(ELEMENT_NAME).append(" xmlns=\"").append(
|
xml.escape(getName());
|
||||||
NAMESPACE).append("\">");
|
|
||||||
buf.append(getName());
|
|
||||||
buf.append("</").append(ELEMENT_NAME).append('>');
|
|
||||||
|
|
||||||
return buf.toString();
|
xml.closeElement(this);
|
||||||
|
return xml;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Provider extends ExtensionElementProvider<Nick> {
|
public static class Provider extends ExtensionElementProvider<Nick> {
|
||||||
|
|
Loading…
Reference in a new issue