Bug 219916

Summary: Certain URL is mangled in browser after clicking it from Konversation
Product: [Applications] konversation Reporter: Jonathan Thomas <echidnaman>
Component: generalAssignee: Konversation Developers <konversation-devel>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Jonathan Thomas 2009-12-24 05:29:34 UTC
Version:           1.2.1 + git (20091217) (using Devel)
OS:                Linux
Installed from:    Compiled sources

Clicking on the following link from Konversation's IrcView ends up in a nice 404:
http://www.bestbuy.com/site/Asus+-+Laptop+with+Intel&#174;+Pentium&#174;+Processor+-+Midnight+Blue/9555992.p?id=1218124206463&skuId=9555992

Seems that the URL is mangled when it ends up in the browser's URL bar. Confirmed by me and Jucato with both Firefox and Chromium.
Comment 1 Jonathan Thomas 2009-12-24 05:32:57 UTC
[23:31:28] <JontheEchidna> Oh, I should note that I am using the "Use custom web browser:" option, which is set to "chromium-browser"
Comment 2 Peter Simonsson 2010-01-05 17:54:59 UTC
commit a5f926d10386544c94a0f91068a03b2c288c7af1
Author: Peter Simonsson <peter.simonsson@gmail.com>
Date:   Tue Jan 5 17:51:51 2010 +0100

    Don't decode URLs before sending them to browser.
    BUG:219916

diff --git a/src/viewer/ircview.cpp b/src/viewer/ircview.cpp
index 35c6d84..1195c12 100644
--- a/src/viewer/ircview.cpp
+++ b/src/viewer/ircview.cpp
@@ -1366,6 +1366,10 @@ void IRCView::mouseMoveEvent(QMouseEvent* ev)
 
         return;
     }
+    else
+    {
+        m_urlToCopy = anchorAt(ev->pos());
+    }
 
     KTextBrowser::mouseMoveEvent(ev);
 }
@@ -1411,7 +1415,7 @@ void IRCView::mouseReleaseEvent(QMouseEvent *ev)
 
 void IRCView::anchorClicked(const QUrl& url)
 {
-    openLink(url.toString());
+    openLink(url.toEncoded());
 }
 
 // FIXME do we still care about newtab? looks like konqi has lots of config now..
@@ -1516,7 +1520,7 @@ void IRCView::highlightedSlot(const QString& _link)
                 m_bookmark->setVisible( true );
                 m_saveUrl->setVisible( true );
             m_copyUrlMenu = true;
-            m_urlToCopy = link;
+//            m_urlToCopy = link;
         }
     }
     else if (link.startsWith('#') && !link.startsWith(QLatin1String("##")))
Comment 3 Peter Simonsson 2010-01-05 17:55:26 UTC
commit a5f926d10386544c94a0f91068a03b2c288c7af1
Author: Peter Simonsson <peter.simonsson@gmail.com>
Date:   Tue Jan 5 17:51:51 2010 +0100

    Don't decode URLs before sending them to browser.
    BUG:219916

diff --git a/src/viewer/ircview.cpp b/src/viewer/ircview.cpp
index 35c6d84..1195c12 100644
--- a/src/viewer/ircview.cpp
+++ b/src/viewer/ircview.cpp
@@ -1366,6 +1366,10 @@ void IRCView::mouseMoveEvent(QMouseEvent* ev)
 
         return;
     }
+    else
+    {
+        m_urlToCopy = anchorAt(ev->pos());
+    }
 
     KTextBrowser::mouseMoveEvent(ev);
 }
@@ -1411,7 +1415,7 @@ void IRCView::mouseReleaseEvent(QMouseEvent *ev)
 
 void IRCView::anchorClicked(const QUrl& url)
 {
-    openLink(url.toString());
+    openLink(url.toEncoded());
 }
 
 // FIXME do we still care about newtab? looks like konqi has lots of config now..
@@ -1516,7 +1520,7 @@ void IRCView::highlightedSlot(const QString& _link)
                 m_bookmark->setVisible( true );
                 m_saveUrl->setVisible( true );
             m_copyUrlMenu = true;
-            m_urlToCopy = link;
+//            m_urlToCopy = link;
         }
     }
     else if (link.startsWith('#') && !link.startsWith(QLatin1String("##")))