url: CURL::GetWithoutUserDetails would return non encoded hostname
authorJoakim Plate <elupus@ecce.se>
Wed, 7 Aug 2013 12:37:03 +0000 (14:37 +0200)
committerJoakim Plate <elupus@ecce.se>
Wed, 7 Aug 2013 12:55:03 +0000 (14:55 +0200)
For rar/zip and similar with an expected url encoded path in their
hostnames, CURL::GetWithoutUserDetails would return an invalidly
formatted non encoded hostname.

xbmc/URL.cpp

index 3c8bcc6..884263e 100644 (file)
@@ -578,10 +578,17 @@ CStdString CURL::GetWithoutUserDetails() const
 
   if (m_strHostName != "")
   {
+    CStdString strHostName;
+
     if (URIUtils::ProtocolHasParentInHostname(m_strProtocol))
-      strURL += CURL(m_strHostName).GetWithoutUserDetails();
+      strHostName = CURL(m_strHostName).GetWithoutUserDetails();
     else
-      strURL += m_strHostName;
+      strHostName = m_strHostName;
+
+    if (URIUtils::ProtocolHasEncodedHostname(m_strProtocol))
+      strURL += URLEncodeInline(strHostName);
+    else
+      strURL += strHostName;
 
     if ( HasPort() )
     {