Pending

User tests: Successful: Unsuccessful:

avatar STUDYHUB02
STUDYHUB02
15 Mar 2025

Pull Request for Issue #45087 .

Summary of Changes

  1. Added an early validation check to detect and block filenames that contain the '$' character.
  2. 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.
  3. These changes ensure that any attempt to rename a file with invalid characters is explicitly rejected, avoiding silent sanitization and user confusion.

Testing Instructions

  1. Open the Media Manager in Joomla.
  2. 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.”
  3. 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.
  4. Verify that renaming files without any '$' characters works as expected.

Actual result BEFORE applying this Pull Request

  1. 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.
  2. 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.
  3. This inconsistent behavior can confuse users about what is allowed and what is not.

Expected result AFTER applying this Pull Request

  1. 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.
  2. Users will see a single, clear error message: “Invalid file name.”
  3. 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

avatar STUDYHUB02 STUDYHUB02 - open - 15 Mar 2025
avatar STUDYHUB02 STUDYHUB02 - change - 15 Mar 2025
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 15 Mar 2025
Category Administration com_media Language & Strings
avatar STUDYHUB02 STUDYHUB02 - change - 18 Mar 2025
Title
Fix media manager invalid filename
[5.2] Fix media manager invalid filename
avatar STUDYHUB02 STUDYHUB02 - edited - 18 Mar 2025
avatar imejine imejine - test_item - 21 Mar 2025 - Tested unsuccessfully
avatar imejine
imejine - comment - 21 Mar 2025

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.

avatar SumCompanyInc SumCompanyInc - test_item - 21 Mar 2025 - Tested unsuccessfully
avatar SumCompanyInc
SumCompanyInc - comment - 21 Mar 2025

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."

https://snipboard.io/qUKTOx.jpg


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/45141.

avatar Agapiiii
Agapiiii - comment - 21 Mar 2025

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.

avatar Agapiiii
Agapiiii - comment - 21 Mar 2025
avatar HLeithner
HLeithner - comment - 15 Apr 2025

This pull request has been automatically rebased to 5.3-dev.

avatar HLeithner HLeithner - change - 15 Apr 2025
Title
[5.2] Fix media manager invalid filename
[5.3] Fix media manager invalid filename
avatar HLeithner HLeithner - edited - 15 Apr 2025

Add a Comment

Login with GitHub to post a comment