Added an early validation check to detect and block filenames that contain the '$' character.
Updated the language file to include a new language string (COM_MEDIA_ERROR_INVALID_FILENAME) that provides a clear error message when disallowed characters are detected.
These changes ensure that any attempt to rename a file with invalid characters is explicitly rejected, avoiding silent sanitization and user confusion.
Testing Instructions
Open the Media Manager in Joomla.
Test Case 1: Attempt to rename a file using a name composed solely of invalid symbols (e.g., $$$).
Expected: The operation should immediately fail with the error “Invalid file name.”
Test Case 2: Attempt to rename a file using a name that includes both valid characters and '$' (e.g., abc$$).
Expected: The operation should be blocked with the same error message, ensuring consistent handling.
Verify that renaming files without any '$' characters works as expected.
Actual result BEFORE applying this Pull Request
When a file is renamed using a name that consists solely of invalid symbols (e.g., $$$), Joomla displays an error indicating that the file name cannot be made safe.
When the file name includes both valid characters and '$' symbols (e.g., abc$$), Joomla silently strips the '$' symbols and renames the file, showing a success message.
This inconsistent behavior can confuse users about what is allowed and what is not.
Expected result AFTER applying this Pull Request
Any attempt to rename a file with a name that contains the '$' character—whether the name is composed solely of '$'
symbols or mixed with valid characters—will be uniformly blocked.
Users will see a single, clear error message: “Invalid file name.”
This change provides a consistent and clear user experience regarding filename validations in the Media Manager.
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
I have tested this item 🔴 unsuccessfully on 44e5e47
i will say that the filename handling tested successfully, however the language en-GB did not seem to pull the right language translation. it showed the language key token, "COM_MEDIA_ERROR_INVALID_FILENAME" instead of, "Invalid file name."
I have tested this item 🔴 unsuccessfully on 44e5e47
Tested with mixed results;
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.