Description
Preconditions and environment
- Magento 2.4.7
Steps to reproduce
- Create folder "Testing"
- Upload file "logo.png" to "Testing" folder
- Create folder "testing"
- "logo.png" file will show in "testing" folder
Expected result
When a file is uploaded to a specific directory, it should only be accessible within that directory. In this case, the "logo.png" file should be exclusively visible within the "Testing" directory.
Actual result
The "logo.png" file is incorrectly displayed within the "testing" directory as well, despite the difference in case. This behavior is unexpected and inconsistent with standard file system behavior.
Additional information
The SQL request that displays the files in media gallery is case insensitive.
Modifying collection query at Magento\MediaGalleryUi\Model\SearchCriteria\CollectionProcessor\FilterProcessor\Directory
$collection->getSelect()->where('path REGEXP ? ', '^' . $value . '/[^\/]*$');
to
$collection->getSelect()->where('BINARY path REGEXP ? ', '^' . $value . '/[^\/]*$');
should fix the issue.
Release note
No response
Triage and priority
- Severity: S0 - Affects critical data or functionality and leaves users without workaround.
- Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
- Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
- Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
- Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.