Skip to content

Commit

Permalink
Improve detection of renames to SVG
Browse files Browse the repository at this point in the history
  • Loading branch information
LukeTowers committed Nov 30, 2023
1 parent 8445b84 commit 2969dae
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/system/classes/MediaLibrary.php
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ public function moveFile($oldPath, $newPath, $isRename = false)
// If the file extension is changed to SVG, ensure that it has been sanitized
$oldExt = pathinfo($oldPath, PATHINFO_EXTENSION);
$newExt = pathinfo($newPath, PATHINFO_EXTENSION);
if ($oldExt !== $newExt && $newExt === 'svg') {
if ($oldExt !== $newExt && strtolower($newExt) === 'svg') {
$contents = $this->getStorageDisk()->get($fullOldPath);
$contents = Svg::sanitize($contents);
$this->getStorageDisk()->put($fullOldPath, $contents);
Expand Down

0 comments on commit 2969dae

Please sign in to comment.