Helpviewer/Passwords/PasswordManager.py

branch
5_5_x
changeset 3683
315b61d73cab
parent 3621
15f23ed3f216
--- a/Helpviewer/Passwords/PasswordManager.py	Sat Jul 05 14:39:33 2014 +0200
+++ b/Helpviewer/Passwords/PasswordManager.py	Sat Jul 05 17:02:12 2014 +0200
@@ -116,11 +116,14 @@
         @param realm realm to get the credentials for (string)
         @return key string (string)
         """
+        authority = url.authority()
+        if authority.startswith("@"):
+            authority = authority[1:]
         if realm:
             key = "{0}://{1} ({2})".format(
-                url.scheme(), url.authority(), realm)
+                url.scheme(), authority, realm)
         else:
-            key = "{0}://{1}".format(url.scheme(), url.authority())
+            key = "{0}://{1}".format(url.scheme(), authority)
         return key
     
     def getFileName(self):
@@ -434,8 +437,15 @@
         """
         cleanUrl = QUrl(url)
         cleanUrl.setQueryItems([])
+        cleanUrl.setUserInfo("")
+        
+        authority = cleanUrl.authority()
+        if authority.startswith("@"):
+            authority = authority[1:]
+        cleanUrl = QUrl("{0}://{1}{2}".format(
+            cleanUrl.scheme(), authority, cleanUrl.path()))
         cleanUrl.setFragment("")
-        cleanUrl.setUserInfo("")
+        
         return cleanUrl
     
     def __findForm(self, webPage, data, boundary=None):
@@ -454,7 +464,8 @@
             args = self.__extractMultipartQueryItems(data, boundary)
         else:
             argsUrl = QUrl.fromEncoded(
-                QByteArray("foo://bar.com/?" + data.replace(b"+", b"%20")))
+                QByteArray("foo://bar.com/?" + QUrl.fromPercentEncoding(
+                    data.replace(b"+", b"%20"))))
             encodedArgs = argsUrl.queryItems()
             args = set()
             for arg in encodedArgs:

eric ide

mercurial