Skip to content

Commit

Permalink
fix bug in default icon component
Browse files Browse the repository at this point in the history
  • Loading branch information
goranalkovic-infinum committed Aug 23, 2024
1 parent 43055ee commit d841326
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion blocks/init/src/Blocks/components/icon/icon.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@

$className = Helpers::getTwClasses($attributes, $manifest, $additionalClass);

$icon = str_replace('<svg ', "<svg class=\"{$className}\"", $icon);
if (!empty($className)) {
$icon = str_replace('<svg ', '<svg class="' . htmlspecialchars($className) . '" ', $icon);
}

// phpcs:ignore Eightshift.Security.HelpersEscape.OutputNotEscaped
echo $icon;

0 comments on commit d841326

Please sign in to comment.