Bug 104256 - [Qt] Fixup urls from user input for WebKit1
Summary: [Qt] Fixup urls from user input for WebKit1
Status: RESOLVED WONTFIX
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Pierre Rossi
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-06 05:50 PST by Pierre Rossi
Modified: 2013-04-04 08:21 PDT (History)
3 users (show)

See Also:


Attachments
Patch (4.25 KB, patch)
2012-12-06 06:52 PST, Pierre Rossi
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Pierre Rossi 2012-12-06 05:50:05 PST
[Qt] Fixup urls from user input for WebKit1
Comment 1 Pierre Rossi 2012-12-06 06:52:04 PST
Created attachment 178006 [details]
Patch
Comment 2 Simon Hausmann 2012-12-06 07:06:04 PST
Ahh, that's what you meant.

I disagree with it. I recall from discussions that in the past we decided against sanitizing after the API layer but instead require people to feed in valid QUrl objects in the first place.
Comment 3 Simon Hausmann 2012-12-06 07:10:29 PST
If we do QUrl::fromUserInput(url.toString()) we do run the risk of data loss.

It would be different if we had a load(QString) function, but as it is today we do take a QUrl object as parameter and if that's not valid (isValid()) returning false I don't think we should try to "fix it up" at the risk of breaking a valid url because of some behaviour in fromUserInput.

Similarly in QString:find(QRegExp) we also don't try to fix up the regex if it's not valid :)
Comment 4 Pierre Rossi 2012-12-06 07:14:11 PST
Comment on attachment 178006 [details]
Patch

As it turns out, there was no regression there, and this already was the behavior in Qt4... After consultation with Jocelyn, it seems what we could do to make this nicer is add a load(const QString&) overload.