Skip to content

Commit e367bf8

Browse files
authored
[4.3] check of invalid json 'joomla.asset.json' (joomla#41135)
1 parent 5be7121 commit e367bf8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

administrator/components/com_templates/src/Model/TemplateModel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -959,7 +959,7 @@ public function save($data)
959959
$data['source'] = str_replace(["\r\n", "\r"], "\n", $data['source']);
960960

961961
// If the asset file for the template ensure we have valid template so we don't instantly destroy it
962-
if ($fileName === '/joomla.asset.json' && json_decode($data['source']) === null) {
962+
if (str_ends_with($fileName, '/joomla.asset.json') && json_decode($data['source']) === null) {
963963
$this->setError(Text::_('COM_TEMPLATES_ERROR_ASSET_FILE_INVALID_JSON'));
964964

965965
return false;

0 commit comments

Comments
 (0)