Skip to content

Commit

Permalink
Missing declaring of variables added. Check that is not null when the…
Browse files Browse the repository at this point in the history
… urlencode() function is called.
  • Loading branch information
fdagner committed Mar 11, 2024
1 parent 8bbed2a commit 53c0f30
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions block_qr.php
Original file line number Diff line number Diff line change
Expand Up @@ -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':
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 53c0f30

Please sign in to comment.