Skip to content

Commit

Permalink
Merge pull request #904 from phunkyfish/fix-xmltv-format-check
Browse files Browse the repository at this point in the history
Fix xmltv format check
  • Loading branch information
phunkyfish authored Oct 8, 2024
2 parents 19dc2e0 + 914acb1 commit 04df2a9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pvr.iptvsimple/addon.xml.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<addon
id="pvr.iptvsimple"
version="22.2.1"
version="22.2.2"
name="IPTV Simple Client"
provider-name="nightik and Ross Nicholson">
<requires>@ADDON_DEPENDS@
Expand Down
3 changes: 3 additions & 0 deletions pvr.iptvsimple/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
v22.2.2
- Fix XMLTV format check

v22.2.1
- Fix XML file format check
- Always treat special paths as local
Expand Down
6 changes: 3 additions & 3 deletions src/iptvsimple/Epg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -226,9 +226,9 @@ const XmltvFileFormat Epg::GetXMLTVFileFormat(const char* buffer)
if (!buffer)
return XmltvFileFormat::INVALID;

if ((buffer[0] != '\x3C' && buffer[std::strlen(buffer) - 1] != '\x3E') || // Start with < and ends with >
(buffer[0] != '\x3C' && buffer[1] != '\x3F' && buffer[2] != '\x78' && // xml should starts with '<?xml'
buffer[3] != '\x6D' && buffer[4] != '\x6C'))
if ((buffer[0] == '\x3C' && buffer[std::strlen(buffer) - 1] == '\x3E') || // Start with < and ends with >
(buffer[0] == '\x3C' && buffer[1] == '\x3F' && buffer[2] == '\x78' && // xml should starts with '<?xml'
buffer[3] == '\x6D' && buffer[4] == '\x6C'))
{
return XmltvFileFormat::NORMAL;
}
Expand Down

0 comments on commit 04df2a9

Please sign in to comment.