]> _ Git - fluidbook_tools.git/commitdiff
wait #7644 @2.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 16 Jul 2025 16:05:01 +0000 (18:05 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 16 Jul 2025 16:05:01 +0000 (18:05 +0200)
src/Links/Link.php

index f371a649af7414ba4b04686d965c48870088f0fe..9b96248c4329df99e5b1c450cb79c0b6f48d21a5 100644 (file)
@@ -181,6 +181,7 @@ class Link
      */
     public static function getInstance($id, $init, &$compiler)
     {
+
         $init = ArrayUtil::asArray($init);
 
         static::normalizeDimensions($init);
@@ -212,6 +213,7 @@ class Link
                     $init['inline'] = 'background_texts';
                     return new VideoBackgroundLink($id, $init, $compiler);
                 }
+                break;
             case static::CUSTOM:
                 return CustomLink::getCustomInstance($id, $init, $compiler);
             case static::WEBVIDEO:
@@ -468,12 +470,11 @@ class Link
 
     public static function getMultimediaInstance($id, $init, &$compiler)
     {
+
         if ($init['to'] == '') {
             return null;
         }
         $init['inline'] = self::normalizeInlineIntegration($init['inline'] ?? '');
-
-
         $ext = mb_strtolower(Files::getExtension($init['to']));
 
         if (in_array($ext, array('oam', 'zip', 'html')) || substr($init['to'], 0, 4) == 'http') {
@@ -906,7 +907,13 @@ class Link
         if (!is_numeric($this->page)) {
             return false;
         }
-        return $this->top + $this->height <= 0 || $this->top > $this->compiler->getHeightForLinks($this->page) || $this->left > $this->compiler->getWidthForLinks($this->page) || $this->left + $this->width <= 0;;
+        if ($this->width === '' || $this->height === '') {
+            return false;
+        }
+        return ($this->top + $this->height) <= 0 ||
+            ($this->left + $this->width <= 0) ||
+            $this->top > $this->compiler->getHeightForLinks($this->page) ||
+            $this->left > $this->compiler->getWidthForLinks($this->page);
     }
 
     public function ignore()