From 53c0f3053b3c0df5707962a15b461406f353898d Mon Sep 17 00:00:00 2001 From: Florian Dagner Date: Mon, 11 Mar 2024 09:42:38 +0100 Subject: [PATCH] Missing declaring of variables added. Check that is not null when the urlencode() function is called. --- block_qr.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/block_qr.php b/block_qr.php index 33b7294..2c25ba6 100644 --- a/block_qr.php +++ b/block_qr.php @@ -99,6 +99,9 @@ public function get_content() { $calendarend = null; $fullview = false; $svgsize = null; + $wifiauthentication = null; + $wifissid = null; + $wifipasskey = null; switch ($this->config->options) { case 'currenturl': @@ -257,8 +260,12 @@ public function get_content() { if (empty($configshortlink)) { $urlshort = null; } else { - $encodedqrcodelink = urlencode($qrcodelink); - $urlshort = str_replace('SHORTLINK', $encodedqrcodelink, $configshortlink); + if ($qrcodelink !== null) { + $encodedqrcodelink = urlencode($qrcodelink); + $urlshort = str_replace('SHORTLINK', $encodedqrcodelink, $configshortlink); + } else { + $urlshort = null; + } } // Size of QR code.