]> _ Git - fluidbook_tools.git/commitdiff
wip #6998 @0.25
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 4 Sep 2024 07:41:56 +0000 (09:41 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 4 Sep 2024 07:41:56 +0000 (09:41 +0200)
src/Links/HTMLMultimediaLink.php

index d290d2d7a4cc6555f548b8bad3de30248adb3ee8..94a044aae92528cc7ed6faac84c449d23f14aae4 100644 (file)
@@ -82,15 +82,18 @@ class HTMLMultimediaLink extends Link
             // ob_end_clean();
             // $this->compiler->log("##### Multimedia Link getHTMLContent ID: {$this->id} | {$this->to} ######\n\n!!!! BACKTRACE !!!!!\n$trace\n===============\n");
 
-            foreach ($this->_config['inject'] as $i) {
-                $infos = ['path' => 'data/links/' . str_replace('.', '_', $this->to) . '/'];
-                $i = str_replace('$id', '"#l_' . $this->id . '"', $i);
-                $i = str_replace('$path', '"' . $infos['path'] . '"', $i);
-                $i = str_replace('$init', Json::encode($infos), $i);
-                // Key the array with the ID so we don't get duplicates even when this function is called multiple times
-                $this->compiler->HTMLMultimedia[$this->id] = $i;
+            if(isset($this->_config['inject'])) {
+                foreach ($this->_config['inject'] as $i) {
+                    $infos = ['path' => 'data/links/' . str_replace('.', '_', $this->to) . '/'];
+                    $i = str_replace('$id', '"#l_' . $this->id . '"', $i);
+                    $i = str_replace('$path', '"' . $infos['path'] . '"', $i);
+                    $i = str_replace('$init', Json::encode($infos), $i);
+                    // Key the array with the ID so we don't get duplicates even when this function is called multiple times
+                    $this->compiler->HTMLMultimedia[$this->id] = $i;
+                }
             }
 
+
             if (isset($this->_config['injectcss'])) {
                 foreach ($this->_config['injectcss'] as $i) {