]> _ Git - fluidbook_tools.git/commitdiff
wait #6167
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 24 Aug 2023 09:32:38 +0000 (11:32 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 24 Aug 2023 09:32:38 +0000 (11:32 +0200)
src/SVG/SVGTools.php

index 43c18b6eefdfdca4a9a1bd2814b2703b98f02f03..f8ee0329233cbac76aaf5baa92a0a00bfcb66384 100644 (file)
@@ -69,7 +69,9 @@ class SVGTools
         if (!$svg) {
             $svg = file_get_contents($in);
         }
-        $svg = str_replace('<svg ', '<svg xmlns="http://www.w3.org/2000/svg" ', $svg);
+        if (!stristr($svg, 'xmlns="http://www.w3.org/2000/svg"')) {
+            $svg = str_replace('<svg ', '<svg xmlns="http://www.w3.org/2000/svg" ', $svg);
+        }
         $svg = self::_disablePreserveRatio($svg);
         file_put_contents($out, $svg);
         return $out;