From e82521ac311c9600c85f88d5f1ed276f8efc5eb4 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Tue, 27 Feb 2024 12:27:01 +0100 Subject: [PATCH] wait #6753 @0.5 --- src/SVG/SVGTools.php | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/src/SVG/SVGTools.php b/src/SVG/SVGTools.php index c8cdaf8..ec9609b 100644 --- a/src/SVG/SVGTools.php +++ b/src/SVG/SVGTools.php @@ -90,7 +90,7 @@ class SVGTools public static function addDimensionsAttributes($in) { - if (!strstr($in, 'addAttribute('height', (float)$e[3]); } - return preg_replace('\<\?xml.*\?\>', '', $xmlsvg->asXML()); + $in = $xmlsvg->asXML(); } } catch (\Exception $e) { - + Log::warning($e->getMessage()); } + return $in; + } + + public static function removeXMLDeclaration($in) + { + return trim(preg_replace('/\<\?xml.*\?\>/', '', $in)); + } + + public static function removeXMLComments($in) + { + return trim(preg_replace('/\