If you try to use this module with files that begin with non-US-ASCII characters, the filenames get truncated. This is because S3fsStreamWrapper.inc uses PHP's basename() in three places, instead of Drupal's drupal_basename.
For example, a file on s3 called "личный профиль.pdf" will be stored in the file_managed table as " профиль.pdf" (with a leading space).
Let me know if you need a patch for this change, otherwise it really is just a find-and-replace of the three basename() calls, replacing with drupal_basename(). I've marked the issue priority as major, since this bug essentially breaks the module's functionality completely for many non-English filenames.
Comments
Comment #2
coredumperror commentedOh wow! I'm kindof shocked that such a huge problem has gone unreported for so many years. Though I'm not at all shocked that PHP sucks so much that its
basename()function would be this broken. That's just par for the shitcourse with PHP.I wish I'd known about
drupal_basename()back when I wrote that code. I'll go ahead and do the search-and-replace, then do a new official release, to get that fix out there ASAP.Comment #4
coredumperror commentedAlright, s3fs 7.x-2.11 is out now.
Comment #6
jeff h commentedThanks for such a prompt fix. Incredible how broken PHP is sometimes 😮