Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix issue where parsing XML character entries are ignored. Fixes issu…

…e #12999.
  • Loading branch information...
commit 565c88f1e7126e1819d9caac55a346c5e6b3dbe0 1 parent 3d8a9ec
@amejia1 amejia1 authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 xbmc/utils/XBMCTinyXML.cpp
View
6 xbmc/utils/XBMCTinyXML.cpp
@@ -21,7 +21,7 @@
#include "filesystem/File.h"
#include "RegExp.h"
-#define MAX_ENTITY_LENGTH 6 // size of largest entity "'"
+#define MAX_ENTITY_LENGTH 8 // size of largest entity "&#xNNNN;"
#define BUFFER_SIZE 4096
CXBMCTinyXML::CXBMCTinyXML()
@@ -130,7 +130,7 @@ const char *CXBMCTinyXML::Parse(CStdString &data, TiXmlParsingData *prevData, Ti
// Preprocess string, replacing '&' with '& for invalid XML entities
size_t pos = 0;
CRegExp re(true);
- re.RegComp("^&(amp|lt|gt|quot|apos);.*");
+ re.RegComp("^&(amp|lt|gt|quot|apos|#x[a-fA-F0-9]{1,4});.*");
while ((pos = data.find("&", pos)) != CStdString::npos)
{
CStdString tmp = data.substr(pos, pos + MAX_ENTITY_LENGTH);
@@ -149,7 +149,7 @@ bool CXBMCTinyXML::Test()
"cache=\"tmdb-en-12244.json\">"
"http://api.themoviedb.org/3/movie/12244"
"?api_key=57983e31fb435df4df77afb854740ea9"
- "&language=en</url></details>");
+ "&language=en&#01af;&#x01AF;</url></details>");
doc.Parse(data.c_str());
TiXmlNode *root = doc.RootElement();
if (root && root->ValueStr() == "details")

1 comment on commit 565c88f

@Voyager1
Collaborator

it seems that this ticket (http://trac.xbmc.org/ticket/13059) reveals that there's still a problem in case the xml code is decimal instead of hexadecimal.

Please sign in to comment.
Something went wrong with that request. Please try again.