File tree 5 files changed +27
-14
lines changed
5 files changed +27
-14
lines changed Original file line number Diff line number Diff line change 1
1
<?xml version =" 1.0" encoding =" UTF-8" ?>
2
2
<addon
3
3
id =" pvr.iptvsimple"
4
- version =" 21.9.1 "
4
+ version =" 21.9.2 "
5
5
name =" IPTV Simple Client"
6
6
provider-name =" nightik and Ross Nicholson" >
7
7
<requires >@ADDON_DEPENDS@
Original file line number Diff line number Diff line change
1
+ v21.9.2
2
+ - Fix XML file format check
3
+ - Always treat special paths as local
4
+
1
5
v21.9.1
2
6
- Fix release build
3
7
Original file line number Diff line number Diff line change @@ -226,19 +226,21 @@ const XmltvFileFormat Epg::GetXMLTVFileFormat(const char* buffer)
226
226
if (!buffer)
227
227
return XmltvFileFormat::INVALID;
228
228
229
- // xml should starts with '<?xml'
230
- if (buffer[0 ] != ' \x3C ' || buffer[1 ] != ' \x3F ' || buffer[2 ] != ' \x78 ' ||
231
- buffer[3 ] != ' \x6D ' || buffer[4 ] != ' \x6C ' )
229
+ if ((buffer[ 0 ] != ' \x3C ' && buffer[ std::strlen (buffer) - 1 ] != ' \x3E ' ) || // Start with < and ends with >
230
+ (buffer[0 ] != ' \x3C ' && buffer[1 ] != ' \x3F ' && buffer[2 ] != ' \x78 ' && // xml should starts with '<?xml'
231
+ buffer[3 ] != ' \x6D ' && buffer[4 ] != ' \x6C ' ) )
232
232
{
233
- // check for BOM
234
- if (buffer[0 ] != ' \xEF ' || buffer[1 ] != ' \xBB ' || buffer[2 ] != ' \xBF ' )
235
- {
236
- // check for tar archive
237
- if (strcmp (buffer + 0x101 , " ustar" ) || strcmp (buffer + 0x101 , " GNUtar" ))
238
- return XmltvFileFormat::TAR_ARCHIVE;
239
- else
240
- return XmltvFileFormat::INVALID;
241
- }
233
+ return XmltvFileFormat::NORMAL;
234
+ }
235
+
236
+ // check for BOM
237
+ if (buffer[0 ] != ' \xEF ' || buffer[1 ] != ' \xBB ' || buffer[2 ] != ' \xBF ' )
238
+ {
239
+ // check for tar archive
240
+ if (strcmp (buffer + 0x101 , " ustar" ) || strcmp (buffer + 0x101 , " GNUtar" ))
241
+ return XmltvFileFormat::TAR_ARCHIVE;
242
+ else
243
+ return XmltvFileFormat::INVALID;
242
244
}
243
245
244
246
return XmltvFileFormat::NORMAL;
Original file line number Diff line number Diff line change @@ -121,6 +121,11 @@ bool WebUtils::IsNfsUrl(const std::string& url)
121
121
return StringUtils::StartsWith (url, NFS_PREFIX);
122
122
}
123
123
124
+ bool WebUtils::IsSpecialUrl (const std::string& url)
125
+ {
126
+ return StringUtils::StartsWith (url, SPECIAL_PREFIX);
127
+ }
128
+
124
129
std::string WebUtils::RedactUrl (const std::string& url)
125
130
{
126
131
std::string redactedUrl = url;
@@ -139,7 +144,7 @@ std::string WebUtils::RedactUrl(const std::string& url)
139
144
bool WebUtils::Check (const std::string& strURL, int connectionTimeoutSecs, bool isLocalPath)
140
145
{
141
146
// For local paths we only need to check existence of the file
142
- if (isLocalPath && FileUtils::FileExists (strURL))
147
+ if (( isLocalPath || IsSpecialUrl (strURL)) && FileUtils::FileExists (strURL))
143
148
return true ;
144
149
145
150
// Otherwise it's remote
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ namespace iptvsimple
16
16
static const std::string HTTP_PREFIX = " http://" ;
17
17
static const std::string HTTPS_PREFIX = " https://" ;
18
18
static const std::string NFS_PREFIX = " nfs://" ;
19
+ static const std::string SPECIAL_PREFIX = " special://" ;
19
20
static const std::string UDP_MULTICAST_PREFIX = " udp://@" ;
20
21
static const std::string RTP_MULTICAST_PREFIX = " rtp://@" ;
21
22
@@ -28,6 +29,7 @@ namespace iptvsimple
28
29
static std::string ReadFileContentsStartOnly (const std::string& url, int * httpCode);
29
30
static bool IsHttpUrl (const std::string& url);
30
31
static bool IsNfsUrl (const std::string& url);
32
+ static bool IsSpecialUrl (const std::string& url);
31
33
static std::string RedactUrl (const std::string& url);
32
34
static bool Check (const std::string& url, int connectionTimeoutSecs, bool isLocalPath = false );
33
35
};
You can’t perform that action at this time.
0 commit comments