| Index: WebCore/platform/chromium/ClipboardChromium.cpp
|
| ===================================================================
|
| --- WebCore/platform/chromium/ClipboardChromium.cpp (revision 10232)
|
| +++ WebCore/platform/chromium/ClipboardChromium.cpp (working copy)
|
| @@ -268,13 +268,14 @@
|
| // use the alt tag if one exists, otherwise we fall back on the suggested
|
| // filename in the http header, and finally we resort to using the filename
|
| // in the URL.
|
| - dataObject->fileExtension = ".";
|
| - dataObject->fileExtension += MIMETypeRegistry::getPreferredExtensionForMIMEType(
|
| + String extension = MIMETypeRegistry::getPreferredExtensionForMIMEType(
|
| cachedImage->response().mimeType());
|
| + dataObject->fileExtension = extension.isEmpty() ? "" : "." + extension;
|
| String title = element->getAttribute(altAttr);
|
| - if (title.isEmpty()) {
|
| + if (title.isEmpty())
|
| title = cachedImage->response().suggestedFilename();
|
| - }
|
| +
|
| + title = ClipboardChromium::validateFileName(title, dataObject);
|
| dataObject->fileContentFilename = title + dataObject->fileExtension;
|
| }
|
|
|
|
|