RTC PR-5.4-dev Pending

User tests: Successful: Unsuccessful:

avatar joomdonation
joomdonation
19 Aug 2026

Pull Request resolves #48273.

  • I read the Generative AI policy and my contribution is either not created with the help of AI or is compatible with the policy and GNU/GPL 2 or later.

Summary of Changes

PR #48171 replace Path::clean by Path::check to prevent path traversal in template manager operations. There were some invalid replacement in that PR causes some features in template manager broken:

  • Cannot create template override
  • Cannot create and delete folder

This PR just fixes wrote error. I also added some missing Path::check to the code when it is needed.

Testing Instructions

  • Uses latest Joomla 5.4
  • Access to a template and try to create override (for components, for modules, for plugins and for layouts). Also try to create, delete folder

Actual result BEFORE applying this Pull Request

  • Error happens. You get error message such as Joomla\Filesystem\Path::check() - Snooping out of bounds @

Expected result AFTER applying this Pull Request

  • No error anymore. Template override for components, modules, plugins and layouts can be created without any problem. Also make sure folder can be created/deleted without any problem.

Link to documentations

Please select:

  • Documentation link for guide.joomla.org:

  • No documentation changes for guide.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

avatar joomdonation joomdonation - open - 19 Aug 2026
avatar joomdonation joomdonation - change - 19 Aug 2026
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 19 Aug 2026
Category Administration com_templates
avatar joomdonation joomdonation - change - 19 Aug 2026
Title
[5.4] Fix multiple errors in Template Manager
[5.4] Fix errors in Template Manager
avatar joomdonation joomdonation - edited - 19 Aug 2026
avatar brianteeman brianteeman - test_item - 19 Aug 2026 - Tested successfully
avatar brianteeman
brianteeman - comment - 19 Aug 2026

I have tested this item ✅ successfully on 0a5e505

tested create and delete folder
tested create and delete files
tested create component override
tested create plugin override
tested create module override

no idea if the problem the original change was made for still exists or not


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

avatar brianteeman
brianteeman - comment - 19 Aug 2026

I have tested this item ✅ successfully on 0a5e505

tested create and delete folder
tested create and delete files
tested create component override
tested create plugin override
tested create module override

no idea if the problem the original change was made for still exists or not


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

avatar joomdonation
joomdonation - comment - 19 Aug 2026

no idea if the problem the original change was made for still exists or not

You meant the path traversal issue which the original PR tried to address? If so, it is still covered by this PR (and this PR also adds few more missing checks).

avatar brianteeman
brianteeman - comment - 19 Aug 2026

no idea if the problem the original change was made for still exists or not

You meant the path traversal issue which the original PR tried to address? If so, it is still covered by this PR (and this PR also adds few more missing checks).

yes - and i wanted to be clear i had not tested that part

avatar muhme muhme - test_item - 19 Aug 2026 - Tested successfully
avatar muhme
muhme - comment - 19 Aug 2026

I have tested this item ✅ successfully on 0a5e505

Tested with JBT

  • Before PR with 5.4.8
    • Seen creating an override in components or plugins crashes, creating or deleting a folder crashes
  • Installed PR with Joomla_5.4.9-dev+pr.48274-Development-Full_Package.zip
avatar muhme
muhme - comment - 19 Aug 2026

I have tested this item ✅ successfully on 0a5e505

Tested with JBT

  • Before PR with 5.4.8
    • Seen creating an override in components or plugins crashes, creating or deleting a folder crashes
  • Installed PR with Joomla_5.4.9-dev+pr.48274-Development-Full_Package.zip
avatar muhme muhme - change - 19 Aug 2026
Status Pending Ready to Commit
avatar muhme
muhme - comment - 19 Aug 2026

RTC


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

avatar muhme
muhme - comment - 19 Aug 2026

RTC


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

avatar richard67 richard67 - test_item - 19 Aug 2026 - Tested successfully
avatar richard67
richard67 - comment - 19 Aug 2026

I have tested this item ✅ successfully on 0a5e505

I've successfully tested the issue and the fix from this PR.

Without the PR applied:

Create folder ❌
Delete folder ❌
Create override - module ✅
Create override - component ❌
Create override - plugins ❌
Create override - layouts ❌
Upload png file ✅❌ (see remark below)

With the PR applied:

Create folder ✅
Delete folder ✅
Create override - module ✅
Create override - component ✅
Create override - plugins ✅
Create override - layouts ✅
Upload png file ✅❌ (see remark below)

Remark

The test for uploading a png file was successful when error reporting was set to system default or none in global configuration.

However, with error reporting = maximum, the image was uploaded and the image editor was shown with this PHP Warning:

Warning: Attempt to read property "filename" on null in /home/richard/lamp/public_html/joomla-cms-5.4-dev/administrator/components/com_templates/tmpl/template/default.php on line 66

Call Stack

#	Time	Memory	Function	Location
1	0.0000	356304	{main}( )	.../index.php:0
2	0.0001	357024	require_once( '/home/richard/lamp/public_html/joomla-cms-5.4-dev/administrator/includes/app.php )	.../index.php:32
3	0.0026	507520	Joomla\CMS\Application\CMSApplication->execute( )	.../app.php:58
4	0.0030	642096	Joomla\CMS\Application\AdministratorApplication->doExecute( )	.../CMSApplication.php:304
5	0.0175	1656040	Joomla\CMS\Application\AdministratorApplication->dispatch( $component = ??? )	.../AdministratorApplication.php:206
6	0.0205	1780048	Joomla\CMS\Component\ComponentHelper::renderComponent( $option = 'com_templates', $params = ??? )	.../AdministratorApplication.php:150
7	0.0209	1832592	Joomla\CMS\Dispatcher\ComponentDispatcher->dispatch( )	.../ComponentHelper.php:361
8	0.0210	1836080	Joomla\CMS\MVC\Controller\BaseController->execute( $task = 'display' )	.../ComponentDispatcher.php:143
9	0.0210	1836080	Joomla\Component\Templates\Administrator\Controller\DisplayController->display( $cachable = ???, $urlparams = ??? )	.../BaseController.php:730
10	0.0210	1836080	Joomla\CMS\MVC\Controller\BaseController->display( $cachable = ???, $urlparams = ??? )	.../DisplayController.php:68
11	0.0213	1844680	Joomla\Component\Templates\Administrator\View\Template\HtmlView->display( $tpl = ??? )	.../BaseController.php:697
12	0.0377	2042504	Joomla\CMS\MVC\View\HtmlView->display( $tpl = NULL )	.../HtmlView.php:218
13	0.0378	2042552	Joomla\CMS\MVC\View\HtmlView->loadTemplate( $tpl = NULL )	.../HtmlView.php:204
14	0.0379	2064256	include( '/home/richard/lamp/public_html/joomla-cms-5.4-dev/administrator/components/com_templates/tmpl/template/default.php )	.../HtmlView.php:419

This happens without this PR as well as with this PR applied.

It seems to depend on your environment if you see this error in backend like I do, or if this error is only logged in the PHP error file like it was observed by @muhme , as far as I remember, when testing another PR.

@joomdonation Do you think this is somehow related to what this PR here touches, and you can fix that with this PR here, too? Or is that something completely different which should be fixed separately with another PR?


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/48274.
avatar richard67
richard67 - comment - 19 Aug 2026

I have tested this item ✅ successfully on 0a5e505

I've successfully tested the issue and the fix from this PR.

Without the PR applied:

Create folder ❌
Delete folder ❌
Create override - module ✅
Create override - component ❌
Create override - plugins ❌
Create override - layouts ❌
Upload png file ✅❌ (see remark below)

With the PR applied:

Create folder ✅
Delete folder ✅
Create override - module ✅
Create override - component ✅
Create override - plugins ✅
Create override - layouts ✅
Upload png file ✅❌ (see remark below)

Remark

The test for uploading a png file was successful when error reporting was set to system default or none in global configuration.

However, with error reporting = maximum, the image was uploaded and the image editor was shown with this PHP Warning:

Warning: Attempt to read property "filename" on null in /home/richard/lamp/public_html/joomla-cms-5.4-dev/administrator/components/com_templates/tmpl/template/default.php on line 66

Call Stack

#	Time	Memory	Function	Location
1	0.0000	356304	{main}( )	.../index.php:0
2	0.0001	357024	require_once( '/home/richard/lamp/public_html/joomla-cms-5.4-dev/administrator/includes/app.php )	.../index.php:32
3	0.0026	507520	Joomla\CMS\Application\CMSApplication->execute( )	.../app.php:58
4	0.0030	642096	Joomla\CMS\Application\AdministratorApplication->doExecute( )	.../CMSApplication.php:304
5	0.0175	1656040	Joomla\CMS\Application\AdministratorApplication->dispatch( $component = ??? )	.../AdministratorApplication.php:206
6	0.0205	1780048	Joomla\CMS\Component\ComponentHelper::renderComponent( $option = 'com_templates', $params = ??? )	.../AdministratorApplication.php:150
7	0.0209	1832592	Joomla\CMS\Dispatcher\ComponentDispatcher->dispatch( )	.../ComponentHelper.php:361
8	0.0210	1836080	Joomla\CMS\MVC\Controller\BaseController->execute( $task = 'display' )	.../ComponentDispatcher.php:143
9	0.0210	1836080	Joomla\Component\Templates\Administrator\Controller\DisplayController->display( $cachable = ???, $urlparams = ??? )	.../BaseController.php:730
10	0.0210	1836080	Joomla\CMS\MVC\Controller\BaseController->display( $cachable = ???, $urlparams = ??? )	.../DisplayController.php:68
11	0.0213	1844680	Joomla\Component\Templates\Administrator\View\Template\HtmlView->display( $tpl = ??? )	.../BaseController.php:697
12	0.0377	2042504	Joomla\CMS\MVC\View\HtmlView->display( $tpl = NULL )	.../HtmlView.php:218
13	0.0378	2042552	Joomla\CMS\MVC\View\HtmlView->loadTemplate( $tpl = NULL )	.../HtmlView.php:204
14	0.0379	2064256	include( '/home/richard/lamp/public_html/joomla-cms-5.4-dev/administrator/components/com_templates/tmpl/template/default.php )	.../HtmlView.php:419

This happens without this PR as well as with this PR applied.

It seems to depend on your environment if you see this error in backend like I do, or if this error is only logged in the PHP error file like it was observed by @muhme , as far as I remember, when testing another PR.

@joomdonation Do you think this is somehow related to what this PR here touches, and you can fix that with this PR here, too? Or is that something completely different which should be fixed separately with another PR?


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/48274.
avatar brianteeman
brianteeman - comment - 19 Aug 2026

I can confirm seeing that error in my logs when uploading a png flle

avatar brianteeman
brianteeman - comment - 19 Aug 2026

I can confirm seeing that error in my logs when uploading a png flle without this PR

avatar richard67 richard67 - change - 19 Aug 2026
Labels Added: RTC PR-5.4-dev
avatar richard67 richard67 - alter_testresult - 19 Aug 2026 - brianteeman: Tested successfully
avatar richard67 richard67 - alter_testresult - 19 Aug 2026 - muhme: Tested successfully
avatar richard67 richard67 - alter_testresult - 19 Aug 2026 - muhme: Tested successfully
avatar richard67 richard67 - alter_testresult - 19 Aug 2026 - richard67: Tested successfully
avatar joomdonation
joomdonation - comment - 20 Aug 2026

@richard67 That warning is not related to the change in this PR and it also not something related to upload. This happens when we access to a file like images, font, archive files from template manager

Fixing this is easy. We basically need to wrap this line of code https://github.com/joomla/joomla-cms/blob/5.4-dev/administrator/components/com_templates/tmpl/template/default.php#L66 inside an if block

<?php if ($this->type === 'file') : ?>
	<p class="lead path hidden"><?php echo $this->escape($this->source->filename); ?></p>
<?php endif; ?>

I can make a separate PR for that, but it will just a blind fix because do not understand the purpose of that code (render absolute path of the file but hidden - maybe for accessibility, I do not know)

avatar richard67
richard67 - comment - 20 Aug 2026

@richard67 That warning is not related to the change in this PR and it also not something related to upload. This happens when we access to a file like images, font, archive files from template manager

@joomdonation Thanks for checking. I can confirm it happens whenever you click e.g. an image in the template manager.

I can make a separate PR for that, but it will just a blind fix because do not understand the purpose of that code (render absolute path of the file but hidden - maybe for accessibility, I do not know)

That would be appreciated.

avatar richard67 richard67 - change - 20 Aug 2026
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2026-08-20 08:51:01
Closed_By richard67
avatar richard67 richard67 - close - 20 Aug 2026
avatar richard67 richard67 - merge - 20 Aug 2026
avatar richard67
richard67 - comment - 20 Aug 2026

Thanks @joomdonation for this PR, @brianteeman and @muhme for testing, and @SniperSister for review.

avatar joomdonation
joomdonation - comment - 20 Aug 2026

That would be appreciated.

@richard67 PR made #48280

Add a Comment

Login with GitHub to post a comment