No Code Attached Yet
avatar ManuelHu
ManuelHu
14 Aug 2023

Steps to reproduce the issue

  • Open a template in the com_templates file browser
  • Try to create a (e.g. PHP) file that contains a minus sign, e.g. enter contains-minus as a file name

Expected result

The file contains-minus.php is created. This is a totally valid filename.

Actual result

The file is not created, and an error message is shown:

COM_TEMPLATES_INVALID_FILE_NAME="Invalid file name. Please choose a file name with a-z, A-Z, 0-9, ., - and _."

The error message states that the action should indeed be allowed...

System information (as much as possible)

  • Joomla 4.3

Additional comments

The bug has been introduced in PR #38987, that removed the trailing - after the 0-9 in the regex. Was there any reason to this, @brianteeman?

avatar ManuelHu ManuelHu - open - 14 Aug 2023
avatar joomla-cms-bot joomla-cms-bot - change - 14 Aug 2023
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 14 Aug 2023
avatar brianteeman
brianteeman - comment - 14 Aug 2023

there is no problem at all creatig a file with an underscore

avatar ManuelHu
ManuelHu - comment - 14 Aug 2023

That's right, you can create files with underscores. But you cannot create a file with a minus sign - sorry about the confusion...

avatar richard67 richard67 - change - 14 Aug 2023
Status New Closed
Closed_Date 0000-00-00 00:00:00 2023-08-14 13:27:00
Closed_By richard67
avatar richard67 richard67 - close - 14 Aug 2023
avatar richard67
richard67 - comment - 14 Aug 2023

Closing as having a pull request. See #41369 .

Add a Comment

Login with GitHub to post a comment