Bug 60522

Summary: mis-escape: <http://bla/> becomes <http://bla/&gt;
Product: [Frameworks and Libraries] kdelibs Reporter: kris
Component: generalAssignee: Andrew Stanley-Jones <asj>
Status: RESOLVED WORKSFORME    
Severity: normal CC: cullmann, lex.lists
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In:

Description kris 2003-06-30 13:01:13 UTC
Version:           1.2.4 (using KDE 3.1.1)
Installed from:    SuSE
Compiler:          gcc version 3.3 20030226 (prerelease) (SuSE Linux)
OS:          Linux (i686) release 2.4.20-4GB

ksirc automatically highlights urls in channels. If that url is bracketed in <> signs (less-than, greater-than), the trailing > sign (greater-than) is being escaped into an entity &gt; (ampersand gt semicolon), and the amp gt part of that text becomes part of the clickable urls.

This only happens to brackets around urls, not other backets.
Comment 1 kris 2003-06-30 13:33:40 UTC
kris@valiant:~/Source/kde/kdelibs/kdecore> diff -u kstringhandler.cpp kstringhan 
dler.cpp.patched 
--- kstringhandler.cpp  2003-06-30 13:28:18.000000000 +0200 
+++ kstringhandler.cpp.patched  2003-06-30 13:27:56.000000000 +0200 
@@ -613,7 +613,7 @@ 
  QString 
 KStringHandler::tagURLs( const QString& text ) 
 { 
-    /*static*/ QRegExp 
urlEx("(www\\.(?!\\.)|(f|ht)tp(|s)://)[\\d\\w\\./,:_~\\?=&;#@\\-\\+\\%]+[\\d\\w/]"); 
+    /*static*/ QRegExp 
urlEx("(?:^|\\s)(www\\.(?!\\.)|(f|ht)tp(|s)://)[\\d\\w\\./,:_~\\?=&;#@\\-\\+\\%]+[\\d\\w/]"); 
 
     QString richText( text ); 
     int urlPos = 0, urlLen; 
 
Please test 
Comment 2 Andrew Stanley-Jones 2003-07-20 05:08:02 UTC
That patch doesn't actually solve the problem.  It just makes <url> not 
higlight the url, but the problem still occurs for < url>, or any string that 
ends in ; 
Comment 3 Andrew Stanley-Jones 2003-07-24 05:56:27 UTC
This is a KStringHander problem, and tagURLs needs a port of the kdepim link 
locator class. 
Comment 4 kris 2004-08-22 20:16:28 UTC
[20:14:31] <Isotopp> <http://blog.koehntopp.de&gt; -- ein test, bitte ignorieren

The problem is still present in kde 3.3 release, using ksirc 1.3.11 (Suse Linux 9.1 precompiled binaries).
Comment 5 lexual 2010-01-23 06:25:37 UTC
Is this still relevant to recent KDE version?
If not please close the bug.

Thanks,

Lex.
Comment 6 Christoph Cullmann 2024-05-01 20:39:54 UTC
Hi,

the KDE libaries and applications version 4.x are obsolete and got replaced
with Frameworks 5 and now 6 based variants that are still maintained.

The issue in this bug doesn't seem to happen for me with these versions.