PATCH: [Bug 83064] SMB URI syntax error

Dawit A. adwa at cox.net
Fri Jul 30 13:32:44 BST 2004


Hello,

The following three patches are intended to fix problems related to incorrect 
filtering of URLs such as "smb:" by the uri filter plugins. For details see 
http://bugs.kde.org/show_bug.cgi?id=83064. Stephan this is the stuff you 
asked me to look into. The fixes are as follows:

ShortURI filter:
============
- Make isValidShortURL check for what it considers to be a valid short URL 
instead of what should not be. This prevents most if not all incorrect 
identification of short URLs.

- Improve the mailto: regexp so that user at 127.0.0.1 or user at kde.org:8080 is 
not translated as a mail URL. Now only things of the form user at host.domain 
are considered to be email address. BTW, simply deleting 
$KDEDIRS/share/config/kshorturifilterrc should remove this match for those 
who do not want it.

- Removed the "localhost" match since that is the domain of the 
localdomainfilter plugin. Removed the ^www  because it will be caught by the 
improved isValidShortURIFilter check. The ftp match was removed because there 
are http sites that start with ftp to denote that they are web frontends to 
an ftp location and as such assuming appending the default protocol to 
everything that starts with "ftp." is not full proof. Moreover, this can be 
added by the user as seen fit to their own kshorturifilterrc file.

LocalDomain filter:
==============
- Removed all the unnecessary checks copied from short URI filter and 
replaced it with a simply regexp check that actually matches what it is 
supposed to match. Same reasoning as the isValidShortURLFilter.

Webshortcut filters:
===============
- Make sure invalid formats of know protocols are not filtered, e.g. "smb:" or 
"http:". That means now entering things of the form "blah:" will result in a 
search using the default search engine.

All these changes pass the regression test in kio/tests/kurifiltertest. The 
only issue left now is the problem with internationalized URLs. The host name 
matching QRegExps in both the short URI and local domain filters only work 
for ascii characters and need to be converted to use \w and/or \D at some 
point. 

Comments, feedback ?

-- 
Regards,
Dawit A.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kshorturifilter.diff
Type: text/x-diff
Size: 8454 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20040730/0277b3cb/attachment.diff>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: localdomainfilter.diff
Type: text/x-diff
Size: 2064 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20040730/0277b3cb/attachment-0001.diff>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: webshortcutsfilter.diff
Type: text/x-diff
Size: 4780 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20040730/0277b3cb/attachment-0002.diff>


More information about the kde-core-devel mailing list