mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2025-09-10 02:39:42 +02:00
VCards data was not being escaped and unescaped properly. SMACK-130
git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@3691 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
parent
aa4b965001
commit
b88871c409
2 changed files with 67 additions and 39 deletions
|
@ -22,6 +22,7 @@ package org.jivesoftware.smackx.provider;
|
|||
|
||||
import org.jivesoftware.smack.packet.IQ;
|
||||
import org.jivesoftware.smack.provider.IQProvider;
|
||||
import org.jivesoftware.smack.util.StringUtils;
|
||||
import org.jivesoftware.smackx.packet.VCard;
|
||||
import org.w3c.dom.*;
|
||||
import org.xmlpull.v1.XmlPullParser;
|
||||
|
@ -35,7 +36,7 @@ import java.util.List;
|
|||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* vCard provider.
|
||||
* vCard provider.
|
||||
*
|
||||
* @author Gaston Dombiak
|
||||
*/
|
||||
|
@ -49,7 +50,8 @@ public class VCardProvider implements IQProvider {
|
|||
while (true) {
|
||||
switch (event) {
|
||||
case XmlPullParser.TEXT:
|
||||
sb.append(parser.getText());
|
||||
// We must re-escape the xml so that the DOM won't throw an exception
|
||||
sb.append(StringUtils.escapeForXML(parser.getText()));
|
||||
break;
|
||||
case XmlPullParser.START_TAG:
|
||||
sb.append('<').append(parser.getName()).append('>');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue