Bug 123819 - & replaces & in urls
Summary: & replaces & in urls
Status: RESOLVED FIXED
Alias: None
Product: konversation
Classification: Applications
Component: ircview (show other bugs)
Version: 0.19
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: argonel
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-03-18 00:20 UTC by Torrie Fischer
Modified: 2006-07-03 16:27 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Torrie Fischer 2006-03-18 00:20:04 UTC
Version:           0.19 (using KDE KDE 3.5.1)
Installed from:    Fedora RPMs

I pasted the url http://www.google.com/mars/#lat=18.229351&lon=-133.352050&zoom=7&q=mountains into my window, and it ended up displaying the first ampersand as &, so the displayed URL was http://www.google.com/mars/#lat=18.229351&lon=-133.352050&zoom=7&q=mountains. It correctly sent the line as recorded by my bot:

Mar 17 18:17:40 Jupiter Pointything: :workman161!~wm161@cloak-BC7D376B.direcpc.com PRIVMSG #php :http://www.google.com/mars/#lat=18.229351&lon=-133.352050&zoom=7&q=mountains

When I asked someone to paste my URL back and see what happens, I recieved http://www.google.com/mars/#lat=18.229351&lon=-133.352050&zoom=7&q=mountains yet my bot recieved the unmodified URL. I tried pasting the & version of it and it ended up being displayed as &, but my bot recieved it correctly.
Comment 1 Eduardo Habkost 2006-06-26 20:34:58 UTC
This problem happens here, also. However, only if the link contains a "#" character. If I someone types "#c&a" in a channel, for example, it is shown as "#c&a" in my chat window.
Comment 2 Eike Hein 2006-07-03 16:27:26 UTC
SVN commit 557557 by hein:

* Fix handling of ampersands in URLs and channel links.
  BUG:123819
* Remove stale code.


 M  +1 -1      common.cpp  
 M  +0 -4      ircview.cpp  


--- trunk/extragear/network/konversation/src/common.cpp #557556:557557
@@ -29,7 +29,7 @@
     #include "unicode.cpp"
 
     static QRegExp colorRegExp("((\003([0-9]|0[0-9]|1[0-5])(,([0-9]|0[0-9]|1[0-5])|)|\017)|\x02|\x09|\x13|\x16|\x1f)");
-    static QRegExp urlPattern("((www\\.(?!\\.)|(fish|(f|ht)tp(|s))://)(\\.?[\\d\\w/,\\':~\\?=;#@\\-\\+\\%\\*\\{\\}\\!\\(\\)]|&)+)|"
+    static QRegExp urlPattern("((www\\.(?!\\.)|(fish|(f|ht)tp(|s))://)(\\.?[\\d\\w/,\\':~\\?=;#@\\-\\+\\%\\*\\{\\}\\!\\(\\)]|&)+)|"
         "([-.\\d\\w]+@[-.\\d\\w]{2,}\\.[\\w]{2,})");
     static QRegExp tdlPattern("(.*)\\.(\\w+),$");
 
--- trunk/extragear/network/konversation/src/ircview.cpp #557556:557557
@@ -332,7 +332,6 @@
     KonversationApplication* konvApp = static_cast<KonversationApplication*>(kapp);
 
     // TODO: Use QStyleSheet::escape() here
-    filteredLine.replace("&","&amp;");
     // Replace all < with &lt;
     filteredLine.replace("<","&lt;");
     // Replace all > with &gt;
@@ -400,9 +399,6 @@
         filteredLine.replace(QRegExp("\003([^0-9]|$)"),"\0031,0\\1");
     }
 
-    // Hack to allow for whois info hostmask info to not be parsed as email
-    filteredLine.replace("&amp;#64;","&#64;");
-
     if(filteredLine.find("\x07") != -1)
     {
         if(Preferences::beep())