Core uses php's file_exists which does a case sensitive determination for if a file already exists and a new file thus needs a numerical suffix when adding a new file.

But filefield_file_download when querying the files table does a case insensitive query. (Same issue in upload's upload_file_download). As a result, I've got two files with case variation only in their filepath. I'm using content_permissions and private files (lol) to determine access to the files, but I get the wrong access for a file due to having another file with a different case and same path otherwise.

Patch is working for me. This may be an issue in HEAD as well, what do you think?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

quicksketch’s picture

Status: Needs review » Fixed
FileSize
1.11 KB

Thanks, yes I agree this is probably an issue with Drupal 7 also. I've applied a version of your patch, but generally I'd think if you're going to be using a case-sensitive file system you might benefit from using a case-sensitive database as well (like PostGres). All queries in MySQL are case-insensitive.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.