From: Vincent Vanwaelscappel Date: Wed, 31 Jan 2024 11:42:18 +0000 (+0100) Subject: wait #6699 @0.75 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=c54867d85adb6782e892721777c91595b26f8794;p=cubist_util.git wait #6699 @0.75 --- diff --git a/src/Animations/ZipAnimation.php b/src/Animations/ZipAnimation.php index 5e27832..ecfb24e 100644 --- a/src/Animations/ZipAnimation.php +++ b/src/Animations/ZipAnimation.php @@ -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, '
') !== 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 {