aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xbmc/URL.cpp3
-rw-r--r--xbmc/filesystem/ResourceFile.cpp7
2 files changed, 7 insertions, 3 deletions
diff --git a/xbmc/URL.cpp b/xbmc/URL.cpp
index b23080d545..f353a344bd 100644
--- a/xbmc/URL.cpp
+++ b/xbmc/URL.cpp
@@ -153,7 +153,8 @@ void CURL::Parse(const std::string& strURL1)
IsProtocol("virtualpath") ||
IsProtocol("multipath") ||
IsProtocol("filereader") ||
- IsProtocol("special")
+ IsProtocol("special") ||
+ IsProtocol("resource")
)
{
SetFileName(strURL.substr(iPos));
diff --git a/xbmc/filesystem/ResourceFile.cpp b/xbmc/filesystem/ResourceFile.cpp
index 47f623af3c..8bd5fe0d29 100644
--- a/xbmc/filesystem/ResourceFile.cpp
+++ b/xbmc/filesystem/ResourceFile.cpp
@@ -49,7 +49,11 @@ bool CResourceFile::TranslatePath(const CURL &url, std::string &translatedPath)
return false;
// the share name represents an identifier that can be mapped to an addon ID
- std::string addonId = url.GetHostName();
+ std::string addonId = url.GetShareName();
+ std::string filePath;
+ if (url.GetFileName().length() > addonId.length())
+ filePath = url.GetFileName().substr(addonId.size() + 1);
+
if (addonId.empty())
return false;
@@ -61,7 +65,6 @@ bool CResourceFile::TranslatePath(const CURL &url, std::string &translatedPath)
if (resource == NULL)
return false;
- std::string filePath = url.GetFileName();
if (!resource->IsAllowed(filePath))
return false;