Skip to content

Conversation

@richard67
Copy link

@richard67 richard67 commented Oct 23, 2021

Pull Request for Issue # .

Summary of Changes

  1. Add stuff from system templates to deleted files and folders.
  2. Add moving of single files (here the preview images) to the procedure for moving to the media folder.
  3. Don't delete preview images with the regular delete procedure doe to the previous change.
  4. Create parent folders at target path if necessary.
  5. Use short array syntax because the function is only present at 4.1 or later.
  6. Clean up unnecessary assignment of the result of Folder::exists in the if condition (was copied from elsewhere).

@dgrammatiko Question: Does it really need to move the preview images? It only makes sense if they could have been modified by the user. If not, they would be in the update package for the media folder and deleted with the regular file delete at the old place, i.e. changes 2. and 3. should be reverted.

@dgrammatiko
Copy link
Owner

Does it really need to move the preview images?

There are 2 possible solutions here:

  • move the files to media (which is a publicly accessible folder)
  • keep the files in their existing place and add a controller function to stream them

I find using PHP for this task is overkill thus I went with the move of the files. Just a reminder that all these files moving make sense if you consider the reason behind them: keep the templates folder inaccessible from the browser, the entry points for any well-tuned Joomla site should be:

  • images
  • media
  • index.php
  • administrator/index.php
  • api/index.php
  • administrator/com_joomlaupdate/extract.php (or update.php)
  • everything else should not be accessible from the browser or the surface of attack is hugely increased

@dgrammatiko dgrammatiko merged commit aa87408 into dgrammatiko:4.1-dev-child-templates Oct 23, 2021
@richard67
Copy link
Author

Does it really need to move the preview images?

There are 2 possible solutions here:

* move the files to media (which is a publicly accessible folder)

* keep the files in their existing place and add a controller function to stream them

I find using PHP for this task is overkill thus I went with the move of the files. Just a reminder that all these files moving make sense if you consider the reason behind them: keep the templates folder inaccessible from the browser, the entry points for any well-tuned Joomla site should be:

* `images`

* `media`

* `index.php`

* `administrator/index.php`

* `api/index.php`

* `administrator/com_joomlaupdate/extract.php` (or update.php)

* everything else **should not be accessible from the browser** or the surface of attack is hugely increased

@dgrammatiko I still don't get why it needs to move the preview images. Can they really have been modified by a user for a core template and do we want to keep these modifications?

@richard67 richard67 deleted the 4.1-dev-dgrammatiko-child-templates-mod-3 branch October 23, 2021 11:09
dgrammatiko pushed a commit that referenced this pull request Feb 21, 2023
dgrammatiko pushed a commit that referenced this pull request Feb 21, 2023
Update SQL Scripts for Postgresql and MySQL and Code Cleanup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants