From f0fbf0a986fcf1ffb0f4653aa63084cf4bf61dda Mon Sep 17 00:00:00 2001 From: Nicolas JUEN Date: Tue, 24 Aug 2021 14:30:17 +0200 Subject: [PATCH] Do not interpretate empty SVG icon name --- inc/Services/Svg.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/inc/Services/Svg.php b/inc/Services/Svg.php index a778ec15..206f8829 100644 --- a/inc/Services/Svg.php +++ b/inc/Services/Svg.php @@ -38,6 +38,10 @@ public function get_service_name(): string { * @return string */ public function get_the_icon( string $icon_class, array $additionnal_classes = [] ): string { + if ( empty( $icon_class ) ) { + return ''; + } + $icon_slug = strpos( $icon_class, 'icon-' ) === 0 ? $icon_class : sprintf( 'icon-%s', $icon_class ); $classes = [ 'icon', $icon_slug ]; $classes = array_merge( $classes, $additionnal_classes );