From: Vincent Vanwaelscappel Date: Fri, 24 Nov 2023 17:35:14 +0000 (+0100) Subject: wait #6516 @0.5 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=627f767b8a69c952902fd70392ab9ca553e60bd9;p=fluidbook_tools.git wait #6516 @0.5 --- diff --git a/src/Links/Link.php b/src/Links/Link.php index 93bba02..c05ddb3 100644 --- a/src/Links/Link.php +++ b/src/Links/Link.php @@ -823,18 +823,21 @@ class Link public function getConfigHTML($d, $html) { - $c = file_get_contents($this->compiler->working_path($html)); - $res = array('width' => $this->video_width, 'height' => $this->video_height); - if (stristr($c, '
')) { - if (preg_match('/var animationData = (\{.*\})/', $c, $m)) { - $ad = json_decode(trim($m[1]), true); - $res['width'] = $ad['w']; - $res['height'] = $ad['h']; + if (Files::isNotEmpty($html)) { + $c = file_get_contents($this->compiler->working_path($html)); + $res = array('width' => $this->video_width, 'height' => $this->video_height); + if (stristr($c, '
')) { + if (preg_match('/var animationData = (\{.*\})/', $c, $m)) { + $ad = json_decode(trim($m[1]), true); + $res['width'] = $ad['w']; + $res['height'] = $ad['h']; + } } - } - $r = array('type' => 'html', 'html' => $html, 'inject' => array(), 'injectcss' => array(), 'injectjs' => array()); + $r = ['type' => 'html', 'html' => $html, 'inject' => array(), 'injectcss' => array(), 'injectjs' => array()]; - return array_merge($res, $r); + return array_merge($res, $r); + } + return []; } public function getConfigOAM($d) @@ -847,7 +850,6 @@ class Link $props = array('default-width' => 'width', 'default-height' => 'height', 'html-page' => 'html'); - $res = array('type' => 'oam', 'inject' => array(), 'injectcss' => array(), 'injectjs' => array(), 'content' => trim($c->content), 'name' => $c->_name, 'assets' => array()); foreach ($c->properties->property as $p) { if (isset($props[$p->_name])) {