Skip to content

Commit

Permalink
[4.3] check of invalid json 'joomla.asset.json' (#41135)
Browse files Browse the repository at this point in the history
  • Loading branch information
heelc29 authored Jul 14, 2023
1 parent 5be7121 commit e367bf8
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -959,7 +959,7 @@ public function save($data)
$data['source'] = str_replace(["\r\n", "\r"], "\n", $data['source']);

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

return false;
Expand Down

0 comments on commit e367bf8

Please sign in to comment.