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

Ingo Klöcker kloecker at kde.org
Sun Aug 2 10:42:14 BST 2009


On Sunday 02 August 2009, Tom Albers wrote:
> 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.

I object. The brackets are excluded so that one can write something 
like:
  Go to the KDE website (www.kde.org).

So if you want to allow brackets inside URLs (which I'm perfectly okay 
with) then please make sure that the above example still works. (I 
suppose we should add a unit test for this.)


Regards,
Ingo
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20090802/4c8ba6d6/attachment.sig>
-------------- 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