Skip to content

Commit

Permalink
[Thumbnail] Validate media query name
Browse files Browse the repository at this point in the history
  • Loading branch information
brusch committed Jan 17, 2022
1 parent d8377fc commit 6f36e84
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions bundles/AdminBundle/Controller/Admin/SettingsController.php
Expand Up @@ -1331,6 +1331,11 @@ public function thumbnailUpdateAction(Request $request)
});

foreach ($mediaData as $mediaName => $items) {

if(preg_match('/["<>]/', $mediaName)) {
throw new \Exception('Invalid media query name');
}

foreach ($items as $item) {
$type = $item['type'];
unset($item['type']);
Expand Down
Expand Up @@ -216,6 +216,10 @@ pimcore.settings.thumbnail.item = Class.create({
name = '(max-width: ' + name.replace("w", "") + 'px)';
}

if(name.match(/["<>]/)) {
return;
}

if (this.medias[name]) {
return;
}
Expand Down

0 comments on commit 6f36e84

Please sign in to comment.