From 73bb6cce228abe2b557339799fa21059d271f516 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Wed, 4 Sep 2024 09:41:56 +0200 Subject: [PATCH] wip #6998 @0.25 --- src/Links/HTMLMultimediaLink.php | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/Links/HTMLMultimediaLink.php b/src/Links/HTMLMultimediaLink.php index d290d2d..94a044a 100644 --- a/src/Links/HTMLMultimediaLink.php +++ b/src/Links/HTMLMultimediaLink.php @@ -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) { -- 2.39.5