Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[4.x]: Craft reports "unable to check if the file exists" when uploading files with BOM characters in file name #13022

Closed
jamiewhitemccann opened this issue Mar 31, 2023 · 3 comments
Assignees

Comments

@jamiewhitemccann
Copy link

What happened?

Description

If we upload assets into Craft CMS that contain BOM (https://en.wikipedia.org/wiki/Byte_order_mark) characters at the end of the file name, then with debug mode enabled, we get the error message:

"unable to check if the file exists"

If the user does not have developer mode enabled, then they get the error message:

"A server error occurred"

Steps to reproduce

  1. Navigate to /admin/assets
  2. Attempt to upload an image with BOM characters, example: Manal-al-Sharif
  3. See one of the above error messages depending on your user settings

Expected behavior

We expected Craft CMS to clean these gremlin characters and upload these files, or at least provide a more user friendly error message for admin users if this is problematic or not possible.

Actual behavior

Confusing error message that required us to debug this issue and work around this by renaming these files and uploading for our client.

Craft CMS version

4.4.4

PHP version

8.0

Operating system and version

Debian GNU/Linux 10 (buster) (Azure App Service Linux)

Database type and version

MySQL 8.0

Image driver and version

imagick module version 3.7.0

Installed plugins and versions

    "craftcms/azure-blob": "2.0.0",
    "craftcms/feed-me": "5.1.1",
    "craftcms/redactor": "3.0.4",
    "nystudio107/craft-retour": "4.1.11",
    "nystudio107/craft-seomatic": "4.0.22",
    "nystudio107/craft-similar": "4.0.0",
    "sebastianlenz/linkfield": "2.1.5",
    "topshelfcraft/wordsmith": "4.2.0",
    "verbb/navigation": "2.0.17",
    "verbb/super-table": "3.0.7",
    "verbb/tablemaker": "4.0.4",
    "vlucas/phpdotenv": "5.5.0",
    "yiisoft/yii2-redis": "2.0.18"
@i-just
Copy link
Contributor

i-just commented Apr 3, 2023

Hi, thanks for reporting! I submitted a PR to adjust this.

@brandonkelly
Copy link
Member

This is fixed for the next Craft 3 and 4 releases, via #13029 and #13028.

@brandonkelly
Copy link
Member

Craft 3.8.6 and 4.4.6 are out with that fix 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants