Skip to content

Commit

Permalink
Fix XMLTV format check
Browse files Browse the repository at this point in the history
  • Loading branch information
phunkyfish committed Oct 8, 2024
1 parent 19dc2e0 commit dbb8597
Showing 1 changed file with 3 additions and 3 deletions.
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 dbb8597

Please sign in to comment.