Bug 169066

Summary: Download attribute set to "*\" save file with name "example.com"
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: DOMAssignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, cdumez, commit-queue, darin, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch none

Description Chris Dumez 2017-03-01 20:31:32 PST
Download attribute set to "*\" save file with name "example.com"
Comment 1 Chris Dumez 2017-03-01 20:32:25 PST
<rdar://problem/30740875>
Comment 2 Chris Dumez 2017-03-01 20:39:20 PST
Created attachment 303168 [details]
Patch
Comment 3 Alex Christensen 2017-03-01 23:24:27 PST
Comment on attachment 303168 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=303168&action=review

> Source/WebCore/platform/network/ResourceResponseBase.cpp:234
> +    String escapedSuggestedFilename = String(suggestedFilename).replace("\\", "\\\\").replace('\"', "\\\"");

'\\' might be slightly more efficient than "\\"
Comment 4 Chris Dumez 2017-03-02 09:03:43 PST
(In reply to comment #3)
> Comment on attachment 303168 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=303168&action=review
> 
> > Source/WebCore/platform/network/ResourceResponseBase.cpp:234
> > +    String escapedSuggestedFilename = String(suggestedFilename).replace("\\", "\\\\").replace('\"', "\\\"");
> 
> '\\' might be slightly more efficient than "\\"

This is an excellent point. I'll fix before landing.
Comment 5 Chris Dumez 2017-03-02 09:05:02 PST
Created attachment 303203 [details]
Patch
Comment 6 WebKit Commit Bot 2017-03-02 09:54:09 PST
Comment on attachment 303203 [details]
Patch

Clearing flags on attachment: 303203

Committed r213284: <http://trac.webkit.org/changeset/213284>
Comment 7 WebKit Commit Bot 2017-03-02 09:54:13 PST
All reviewed patches have been landed.  Closing bug.
Comment 8 Darin Adler 2017-03-05 12:26:04 PST
Comment on attachment 303203 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=303203&action=review

> Source/WebCore/platform/network/ResourceResponseBase.cpp:234
> +    String escapedSuggestedFilename = String(suggestedFilename).replace('\\', "\\\\").replace('\"', "\\\"");

There’s an extra unneeded backslash here (was already here before the patch). It should be '"', not '\"'.
Comment 9 Chris Dumez 2017-03-05 16:55:50 PST
Reopening to attach new patch.
Comment 10 Chris Dumez 2017-03-05 16:55:58 PST
Created attachment 303485 [details]
Patch
Comment 11 WebKit Commit Bot 2017-03-05 17:37:56 PST
Comment on attachment 303485 [details]
Patch

Clearing flags on attachment: 303485

Committed r213439: <http://trac.webkit.org/changeset/213439>
Comment 12 WebKit Commit Bot 2017-03-05 17:38:01 PST
All reviewed patches have been landed.  Closing bug.