]> _ Git - cubist_util.git/commitdiff
wait #6699 @0.75
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 31 Jan 2024 11:42:18 +0000 (12:42 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 31 Jan 2024 11:42:18 +0000 (12:42 +0100)
src/Animations/ZipAnimation.php

index 5e278320aa0ec304edd470dfa6d50cfc91ba08f5..ecfb24ec25938b3b197681656ca70d65bc220fd6 100644 (file)
@@ -2,6 +2,7 @@
 
 namespace Cubist\Util\Animations;
 
+use Cubist\Util\Text;
 use DOMDocument;
 use DOMElement;
 use DOMXPath;
@@ -13,11 +14,12 @@ class ZipAnimation extends OAMAnimation
         $unz = self::unzipOAM($src, null, 'zip');
         $index = $unz . '/index.html';
         if (file_exists($index)) {
-            $c = file_get_contents($index);
+            $c = Text::normalizeLines(file_get_contents($index));
             $res['html'] = $c;
             if (stripos($c, '<div id="lottie"></div>') !== false) {
                 preg_match('/var animationData = (\{.*\})/', $c, $m);
-                $ad = json_decode(trim($m[1]), true);
+                $content = trim($m[1]);
+                $ad = json_decode($content, true);
                 $res['width'] = $ad['w'];
                 $res['height'] = $ad['h'];
             } else {