[webkit-reviews] review granted: [Bug 175081] Web Automation: consider file extensions in the "accept" attribute when deciding if a file can be uploaded : [Attachment 316983] Patch
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Wed Aug 2 21:31:16 PDT 2017
Joseph Pecoraro <joepeck at webkit.org> has granted Brian Burg <bburg at apple.com>'s
request for review:
Bug 175081: Web Automation: consider file extensions in the "accept" attribute
when deciding if a file can be uploaded
https://bugs.webkit.org/show_bug.cgi?id=175081
Attachment 316983: Patch
https://bugs.webkit.org/attachment.cgi?id=316983&action=review
--- Comment #6 from Joseph Pecoraro <joepeck at webkit.org> ---
Comment on attachment 316983
--> https://bugs.webkit.org/attachment.cgi?id=316983
Patch
View in context: https://bugs.webkit.org/attachment.cgi?id=316983&action=review
r=me, but you may want to tighten up the extension checking.
> Source/WebKit/UIProcess/Automation/WebAutomationSession.cpp:540
> String extension = filename.substring(filename.reverseFind('.') + 1);
There must be a better way to get a file's extension.
However this does pretty much match what `File::computeNameAndContentType` does
it in WebCore/fileapi/File.cpp.
• What if this is a hidden file: ~/.bashrc
• What if this doesn't have an extension? /tmp/foo
• Is the filename here just a name or a path? /tmp/.hidden/foo
I think you will still at the very least want to handle if reverseFind returns
WTF::notFound.
More information about the webkit-reviews
mailing list