Bug 104256

Summary: [Qt] Fixup urls from user input for WebKit1
Product: WebKit Reporter: Pierre Rossi <pierre.rossi>
Component: New BugsAssignee: Pierre Rossi <pierre.rossi>
Status: RESOLVED WONTFIX    
Severity: Normal CC: hausmann, jturcotte, vestbo
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

Pierre Rossi
Reported 2012-12-06 05:50:05 PST
[Qt] Fixup urls from user input for WebKit1
Attachments
Patch (4.25 KB, patch)
2012-12-06 06:52 PST, Pierre Rossi
no flags
Pierre Rossi
Comment 1 2012-12-06 06:52:04 PST
Simon Hausmann
Comment 2 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.
Simon Hausmann
Comment 3 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 :)
Pierre Rossi
Comment 4 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.
Note You need to log in before you can comment on or make changes to this bug.