-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
[5.2] Fix media manager invalid filename #45141
base: 5.2-dev
Are you sure you want to change the base?
[5.2] Fix media manager invalid filename #45141
Conversation
This commit introduces an early validation check to detect and block filenames containing the '$' character. Previously, when renaming a file that included '$', Joomla would silently strip the invalid symbol if mixed with valid characters, leading to inconsistent behavior. Changes: - Added a check in move() to throw an exception with a clear error message if the destination filename contains '$'. - This change ensures that any filename containing '$' is explicitly rejected, providing a consistent user experience. Reference: [Issue joomla#45087] for details on the problem.
This commit adds a new language string to support the validation of filenames containing the '$' character. The new string, COM_MEDIA_ERROR_INVALID_FILENAME, provides a clear error message when a filename with disallowed characters is encountered, ensuring consistent feedback for users. Language string added: COM_MEDIA_ERROR_INVALID_FILENAME="Invalid file name." This update complements the changes in ApiModel.php for consistent handling of invalid filenames. See Issue joomla#45087 for details.
I have tested this item 🔴 unsuccessfully on 44e5e47 https://snipboard.io/bofT4D.jpg After patch, file is not renamed (success), but the error shown is not the expected string/message (fail). This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/45141. |
I have tested this item 🔴 unsuccessfully on 44e5e47 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/45141. |
The patch Is successful in getting error when renaming a file/folder with a special symbol, but it displays an incorrect error message This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/45141. |
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/45141. |
Pull Request for Issue #45087 .
Summary of Changes
Testing Instructions
Expected: The operation should immediately fail with the error “Invalid file name.”
Expected: The operation should be blocked with the same error message, ensuring consistent handling.
Actual result BEFORE applying this Pull Request
Expected result AFTER applying this Pull Request
symbols or mixed with valid characters—will be uniformly blocked.
Link to documentations
Please select:
Documentation link for docs.joomla.org:
No documentation changes for docs.joomla.org needed
Pull Request link for manual.joomla.org:
No documentation changes for manual.joomla.org needed