[chromium] Fix ClipboardChromium::validateFilename to actually operate on extensions
authordcheng@chromium.org <dcheng@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 26 Jan 2012 05:02:12 +0000 (05:02 +0000)
committerdcheng@chromium.org <dcheng@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 26 Jan 2012 05:02:12 +0000 (05:02 +0000)
commit1954a536d6e63abca25bd660cb747a9fb6018fa1
tree0c52aa6f2ee93cec243e7836a5e08d8c572e3f3d
parent02ec509439206beb6b911f59376d8ddff2d9aee9
[chromium] Fix ClipboardChromium::validateFilename to actually operate on extensions
https://bugs.webkit.org/show_bug.cgi?id=76996

Source/WebCore:

As it turns out, we were always calling validateFilename on a data object with an empty
extension. Now we call it on an actual extension so that it's sanitized.

Reviewed by Tony Chang.

Unit test: webkit_unit_tests --gtest_filter=ClipboardChromium.*

* WebCore.gypi:
* platform/chromium/ClipboardChromium.cpp:
(WebCore::writeImageToDataObject):
* platform/chromium/ClipboardChromium.h:
(ClipboardChromium):
* platform/chromium/ClipboardChromiumLinux.cpp: Removed.
* platform/chromium/ClipboardChromiumPosix.cpp: Renamed from Source/WebCore/platform/chromium/ClipboardChromiumMac.cpp.
(WebCore):
(WebCore::isInvalidFileCharacter):
(WebCore::ClipboardChromium::validateFilename):
* platform/chromium/ClipboardChromiumWin.cpp:
(WebCore):
(WebCore::ClipboardChromium::validateFilename):

Source/WebKit/chromium:

Reviewed by Tony Chang.

* WebKit.gypi:
* tests/ClipboardChromiumTest.cpp: Added.
(WebCore):
(WebCore::TEST):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@105962 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/WebCore.gypi
Source/WebCore/platform/chromium/ClipboardChromium.cpp
Source/WebCore/platform/chromium/ClipboardChromium.h
Source/WebCore/platform/chromium/ClipboardChromiumLinux.cpp [deleted file]
Source/WebCore/platform/chromium/ClipboardChromiumPosix.cpp [moved from Source/WebCore/platform/chromium/ClipboardChromiumMac.cpp with 58% similarity]
Source/WebCore/platform/chromium/ClipboardChromiumWin.cpp
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/WebKit.gypi
Source/WebKit/chromium/tests/ClipboardChromiumTest.cpp [new file with mode: 0644]