From 5d43f110c607f9b9692a8df45fdba6d32c5cf315 Mon Sep 17 00:00:00 2001 From: valoulou Date: Fri, 9 Aug 2019 09:48:21 -0400 Subject: [PATCH] Fix + sign HTTP folder Fix + sign HTTP Folder --- xbmc/filesystem/HTTPDirectory.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/xbmc/filesystem/HTTPDirectory.cpp b/xbmc/filesystem/HTTPDirectory.cpp index 484c00efe26b7..d95c9e304f181 100644 --- a/xbmc/filesystem/HTTPDirectory.cpp +++ b/xbmc/filesystem/HTTPDirectory.cpp @@ -103,6 +103,18 @@ bool CHTTPDirectory::GetDirectory(const CURL& url, CFileItemList &items) strLinkOptions = strLinkBase.substr(pos); strLinkBase.erase(pos); } + + // encoding + and ; to URL encode if it is not already encoded by http server used on the remote server (example: Apache) + // more characters may be added here when required when required by certain http servers + pos = strLinkBase.find_first_of("+;"); + while (pos != std::string::npos) + { + std::stringstream convert; + convert << '%' << std::hex << int(strLinkBase.at(pos)); + strLinkBase.replace(pos, 1, convert.str()); + pos = strLinkBase.find_first_of("+;"); + } + std::string strLinkTemp = strLinkBase; URIUtils::RemoveSlashAtEnd(strLinkTemp);