? Language Change PR-4.3-dev Pending

User tests: Successful: Unsuccessful:

avatar brianteeman
brianteeman
18 Oct 2022

Pull Request for Issue # #38455 .

Second attempt - different approach to #38458

Summary of Changes

(?!\.) - don't allow . at start
(?!.*\.\.) - don't allow 2 consecutive dots
(?!.*\.$) - don't allow . at end
[a-zA-Z0-9_.] only allow these characters

It is currently possible to upload a file.min.css, file.min.js, file.asset.json

However it is not possible to rename or create a new file as we had a check to prevent having a . in the name

There really is no need for this restriction. It dates back 10 years to a security fix but it wasn't needed as the rest of the security fix is still valid.

NOTE: This does not add .min.css or .min.js or asset.json to the list of filetypes. They are still just css, js and json but now you can put a dot in the filename

image

image

Testing Instructions

  1. Create files as below

  2. Rename existing files as below

.template
template.
template
template.min
_template
template_
temp_late
9emplate
template9
temp.la.te.
temp..late

Expected result AFTER applying this Pull Request


.template ❌ (note this will be saved as template)
template. ❌
template ✔️
template.min ✔️
_template ✔️
template_ ❌
temp_late ✔️
9emplate ✔️
template9 ✔️
temp.la.te. ❌
temp..late ❌


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

6679774 18 Oct 2022 avatar brianteeman lang
avatar brianteeman brianteeman - open - 18 Oct 2022
avatar brianteeman brianteeman - change - 18 Oct 2022
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 18 Oct 2022
Category Administration com_templates Language & Strings
avatar brianteeman brianteeman - change - 18 Oct 2022
The description was changed
avatar brianteeman brianteeman - edited - 18 Oct 2022
avatar wilsonge
wilsonge - comment - 18 Oct 2022

//cc @joomla/security in case you want to review. Not a blocker for them to review though - I think this looks fine in my eyes

avatar richard67
richard67 - comment - 18 Oct 2022

@brianteeman Maybe you should quote the file names in the testing instructions like we quote code because the underscores are not visible. The text is shown in italics instead. At least that's what I see on GitHub.

avatar brianteeman brianteeman - change - 18 Oct 2022
The description was changed
avatar brianteeman brianteeman - edited - 18 Oct 2022
avatar brianteeman brianteeman - change - 18 Oct 2022
The description was changed
avatar brianteeman brianteeman - edited - 18 Oct 2022
avatar brianteeman
brianteeman - comment - 18 Oct 2022

@richard67 thanks - I didnt spot that - I have updated it now

avatar brianteeman
brianteeman - comment - 21 Oct 2022

Drone errors are unrelated to this PR

avatar HLeithner HLeithner - change - 21 Oct 2022
Labels Added: Language Change PR-4.3-dev
avatar coolcat-creations
coolcat-creations - comment - 24 Oct 2022

I have tested this item successfully on 38b0b81

.something (note this will be saved as template) - done and successful
template. - done and successful
template ✔️ - done and successful
template.min ✔️ - done and successful
template ✔️ - done and successful
**template
Acually created but I see no problem with it?**
temp_late ✔️ - done and successful
9emplate ✔️ - done and successful
template9 ✔️ - done and successful
temp.la.te. - done and successful
temp..late - done and successful


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

avatar coolcat-creations coolcat-creations - test_item - 24 Oct 2022 - Tested successfully
avatar richard67 richard67 - alter_testresult - 24 Oct 2022 - coolcat-creations: Tested successfully
avatar obuisard
obuisard - comment - 27 Oct 2022

I have tested this item successfully on 1df6157

Saving .tada.css will not fail, but save as tada.css (on Windows system).


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

avatar obuisard
obuisard - comment - 27 Oct 2022

I have tested this item successfully on 1df6157

Saving .tada.css will not fail, but save as tada.css (on Windows system).


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

avatar obuisard obuisard - test_item - 27 Oct 2022 - Tested successfully
avatar brianteeman
brianteeman - comment - 27 Oct 2022

Saving .tada.css will not fail, but save as tada.css (on Windows system).

That's the same before this PR. There is other validation taking place elsewhere

avatar crystalenka crystalenka - test_item - 15 Nov 2022 - Tested successfully
avatar crystalenka
crystalenka - comment - 15 Nov 2022

I have tested this item successfully on 37e3c9c

Thank you Brian!


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

avatar richard67 richard67 - alter_testresult - 15 Nov 2022 - obuisard: Tested successfully
avatar richard67
richard67 - comment - 15 Nov 2022

I've restored @obuisard 's test result which was invalidated by the branch update in the issue tracker's test counter.

Please avoid unnecessary branch update because that invalidates the test counters and makes it harder for us to find the PRs which have 2 tests.

avatar richard67 richard67 - change - 15 Nov 2022
Status Pending Ready to Commit
avatar richard67
richard67 - comment - 15 Nov 2022

RTC


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

avatar obuisard obuisard - change - 15 Nov 2022
Labels Added: ?
avatar obuisard obuisard - change - 15 Nov 2022
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2022-11-15 18:59:29
Closed_By obuisard
avatar obuisard obuisard - close - 15 Nov 2022
avatar obuisard obuisard - merge - 15 Nov 2022
avatar obuisard
obuisard - comment - 15 Nov 2022

Thank you Brian @brianteeman for the PR!

avatar brianteeman
brianteeman - comment - 15 Nov 2022

Thank you. Now just needs the tinymce.min.css pr to be merged

avatar richard67
richard67 - comment - 15 Nov 2022

Thank you. Now just needs the tinymce.min.css pr to be merged

@brianteeman You mean this one #39124 ? Or a new one which is to be created?

avatar brianteeman
brianteeman - comment - 15 Nov 2022

yes thats the one

avatar richard67
richard67 - comment - 15 Nov 2022

That's for 4.2-dev. So it would not only need to be merged but also to be merged up afterwards.

avatar brianteeman
brianteeman - comment - 15 Nov 2022

well it needs to be tested as well ;)

Add a Comment

Login with GitHub to post a comment