[Kde-pim] linklocator.cpp change in parsing URLs

Tom Albers toma at kde.org
Sun Aug 2 09:44:32 BST 2009


Op Sunday 02 August 2009 00:44 schreef u:
> Hi,
> 
> in wanting to fix https://bugs.kde.org/show_bug.cgi?id=201900
> which mainly is about allowing "()" chars in an URL, I'd like to propose this
> patch.
> Does anyone know why there is this restriction with "<>()[]" implemented at all
> ?
> Can't this be simply removed ?
> 
>  (The comment above:
>   // handle cases like this: <link>http://foobar.org/</link>
>  only gives a small hint, but still () [] could be removed)
> 
> 
> Index: linklocator.cpp
> ===================================================================
> --- linklocator.cpp     (Revision 1005193)
> +++ linklocator.cpp     (Arbeitskopie)
> @@ -111,7 +111,7 @@
>      int start = mPos;
>      while ( mPos < (int)mText.length() &&
>              mText[mPos] > ' ' && mText[mPos] != '"' &&
> -            QString( "<>()[]" ).indexOf( mText[mPos] ) == -1 ) {
> +            QString( "<>[]" ).indexOf( mText[mPos] ) == -1 ) {
>        ++mPos;
>      }
> 

rfc1738:
   Thus, only alphanumerics, the special characters "$-_.+!*'(),", and
   reserved characters used for their reserved purposes may be used
   unencoded within a URL.

The [] should be encoded and is not allowed. So your patch is correct.  Please commit. 

Toma
-- 
KDE Developer
-------------- next part --------------
_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/


More information about the kde-pim mailing list