Skip to content

Commit

Permalink
Merge pull request #727 from phunkyfish/no-encode-kodi-protocols
Browse files Browse the repository at this point in the history
Don't URL encode paths using resource:// or special:// protocols
  • Loading branch information
phunkyfish authored Mar 22, 2023
2 parents b6c18e7 + be8cf14 commit b73472e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 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="20.9.0"
version="20.9.1"
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 @@
v20.9.1
- Don't URL encode paths using resource:// or special:// protocols

v20.9.0
- Support async connect

Expand Down
12 changes: 11 additions & 1 deletion src/iptvsimple/data/Channel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,16 @@ void Channel::Reset()
m_inputStreamName.clear();
}

namespace
{

bool IsSpecialOrResourceProtocol(const std::string& path)
{
return StringUtils::StartsWith(path, "special://") || StringUtils::StartsWith(path, "resource://");
}

}

void Channel::SetIconPathFromTvgLogo(const std::string& tvgLogo, std::string& channelName)
{
m_iconPath = tvgLogo;
Expand All @@ -134,7 +144,7 @@ void Channel::SetIconPathFromTvgLogo(const std::string& tvgLogo, std::string& ch
{
m_iconPath = utilities::WebUtils::UrlEncode(m_iconPath);
}
else if (m_iconPath.find("://") != std::string::npos)
else if (m_iconPath.find("://") != std::string::npos && !IsSpecialOrResourceProtocol(m_iconPath))
{
// we also want to check the last part of a URL to ensure it's valid as quite often they are based on channel names
// the path should be fine
Expand Down

0 comments on commit b73472e

Please sign in to comment.