Sometimes, when uploading an image with transliteration enabled, the filename end up consisting only of the extension

Steps to reproduce:
I assume that you have transliteration installed/enabled and have a image field somewhere.

  1. Rename a file to e.g. '~.png'
  2. Upload the file in a image field

Drupal reports the following:

For security reasons, your upload has been renamed to png..

And the field fails with the following message:

The specified file png. could not be uploaded. Only files with the following extensions are allowed: jpg jpeg gif png txt doc xls pdf ppt pps odt ods odp.

Proposed solution:
Do not remove any characters from filename. Replace them with something safe instead. When filename only consist of disallowed characters we should still be able to upload/save the file.

CommentFileSizeAuthor
#1 filename-sometimes-empty-2031193-0.patch710 bytesmian3010
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mian3010’s picture

Attached proposed solution

amateescu’s picture

Status: Active » Closed (duplicate)

There's a patch in the queue that makes this configurable: #862248-8: Option to keep space. I think we should concentrate the efforts in that issue.