Bug 132687

Summary: special chars in URL are escaped (and more) when atom feed is imported from Konq's statusbar
Product: [Applications] akregator Reporter: Stefan Monov <logixoul>
Component: akregator konqueror pluginAssignee: kdepim bugs <kdepim-bugs>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: 1.2.4   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In:

Description Stefan Monov 2006-08-20 15:34:01 UTC
Version:           1.2.4 (using KDE KDE 3.5.4)
Installed from:    SuSE RPMs
OS:                Linux

How to reproduce:
1. Go to http://en.wikipedia.org/w/index.php?title=Akregator&action=history
2. Click the Feed icon in the statusbar
3. Choose Atom 0.3

Observed behavior:
http://en.wikipedia.org/w/index.php%3Ftitle%3DAkregator%26amp;action%3Dhistory%26amp;feed%3Datom%253Ftitle%253DAkregator%26amp;feed%3Drss?title=Akregator&action=history&feed=atom?title=Akregator&action=history
is added.

Expected behavior:
http://en.wikipedia.org/w/index.php?title=Akregator&action=history&feed=atom
is added.
Comment 1 Eckhart Wörner 2006-08-20 15:46:50 UTC
Looks like PluginBase::fixRelativeURL does not work as expected. Confirmed.
Comment 2 Frank Osterfeld 2006-08-20 18:34:31 UTC
SVN commit 575021 by osterfeld:

fix completion of URLs starting with "/",
e.g. baseurl=http://foobar.com/feeds, link=/feeds/atom.xml
BUG: 132687


 M  +7 -5      pluginbase.cpp  


--- branches/KDE/3.5/kdeaddons/konq-plugins/akregator/pluginbase.cpp #575020:575021
@@ -83,19 +83,21 @@
         }
         else if (s2.startsWith("/"))
         {
-            u=baseurl;
-            u.setPath(s2);
+            KURL b2(baseurl);
+            b2.setPath(QString()); // delete path and query, so that only protocol://host remains
+            b2.setQuery(QString());
+            u = KURL(b2, s2.remove(0,1)); // remove leading "/" 
         }
         else
         {
-            u=baseurl;
-            u.addPath(s2);
+            u = KURL(baseurl, s2);
         }
-        u.cleanPath();
     }
     else
         u=s2;
 
     u.cleanPath();
+    //kdDebug() << "AKREGATOR_PLUGIN_FIXURL: " << "url=" << s << " baseurl=" << baseurl.url() << " fixed=" << u.url() << 
+endl;
     return u.url();
 }
Comment 3 Frank Osterfeld 2006-08-20 18:37:23 UTC
SVN commit 575024 by osterfeld:

forwardport #132687
CCBUG: 132687


 M  +7 -5      pluginbase.cpp  


--- trunk/KDE/kdeaddons/konq-plugins/akregator/pluginbase.cpp #575023:575024
@@ -81,19 +81,21 @@
         }
         else if (s2.startsWith("/"))
         {
-            u=baseurl;
-            u.setPath(s2);
+            KUrl b2(baseurl);
+            b2.setPath(QString()); // delete path and query, so that only protocol://host remains
+            b2.setQuery(QString());
+            u = KUrl(b2, s2.remove(0,1)); // remove leading "/" 
         }
         else
         {
-            u=baseurl;
-            u.addPath(s2);
+            u = KUrl(baseurl, s2);
         }
-        u.cleanPath();
     }
     else
         u=s2;
 
     u.cleanPath();
+    //kdDebug() << "AKREGATOR_PLUGIN_FIXURL: " << "url=" << s << " baseurl=" << baseurl.url() << " fixed=" << u.url() << 
+endl;
     return u.url();
 }