diff --git a/app/controllers/blubber.php b/app/controllers/blubber.php
index 06390970c5ee5924e5b792675bedf857731cef95..d89916ccabdbf9f0b1f7fc391c2c842d697ccf80 100644
--- a/app/controllers/blubber.php
+++ b/app/controllers/blubber.php
@@ -57,7 +57,10 @@ class BlubberController extends AuthenticatedController
             );
         }
 
-        if (!Avatar::getAvatar($GLOBALS['user']->id)->is_customized() && !$_SESSION['already_asked_for_avatar']) {
+        if (
+            empty($_SESSION['already_asked_for_avatar'])
+            && !Avatar::getAvatar($GLOBALS['user']->id)->is_customized()
+        ) {
             $_SESSION['already_asked_for_avatar'] = true;
             PageLayout::postInfo(sprintf(
                 _('Wollen Sie ein Avatar-Bild nutzen? %sLaden Sie jetzt ein Bild hoch%s.'),
diff --git a/app/views/course/scm/edit.php b/app/views/course/scm/edit.php
index ca46f649c889dfc27edce8f4bb2a5921f71e0177..87ad30f046e6a51628a7cc32c53eb0695eaa0680 100644
--- a/app/views/course/scm/edit.php
+++ b/app/views/course/scm/edit.php
@@ -52,7 +52,7 @@
 
     <footer data-dialog-button>
         <?= Studip\Button::createAccept(_('Speichern'), 'submit') ?>
-    <? if ($first_entry): ?>
+    <? if (!empty($first_entry)): ?>
         <?= Studip\LinkButton::createCancel(_('Abbrechen'), URLHelper::getLink('seminar_main.php')) ?>
     <? else: ?>
         <?= Studip\LinkButton::createCancel(_('Abbrechen'), $controller->url_for('course/scm/' . $scm->id)) ?>
diff --git a/app/views/files/_fileref_tr.php b/app/views/files/_fileref_tr.php
index ea8315897998860b5164075220e2c7e9da46728d..f282f7924f13dc726b721e6229a899654b9c6f44 100644
--- a/app/views/files/_fileref_tr.php
+++ b/app/views/files/_fileref_tr.php
@@ -11,7 +11,7 @@ if ($file->isDownloadable($GLOBALS['user']->id)) {
     <?= !empty($table_id) ? 'id="' . htmlReady("fileref_{$table_id}_{$file->getId()}") . '"' : '' ?>
     role="row"
     data-permissions="<?= implode($permissions) ?>">
-    <? if ($show_bulk_checkboxes) : ?>
+    <? if (!empty($show_bulk_checkboxes)) : ?>
         <td>
             <? if ($file->isDownloadable($GLOBALS['user']->id)) : ?>
                 <input type="checkbox"
diff --git a/lib/models/OpenGraphURL.class.php b/lib/models/OpenGraphURL.class.php
index a1d4c7210030af54a2ba6a00e92d3b9c3ca18e68..62eecc45145c4a633ef415fb1cbf9738009d1651 100644
--- a/lib/models/OpenGraphURL.class.php
+++ b/lib/models/OpenGraphURL.class.php
@@ -305,7 +305,11 @@ class OpenGraphURL extends SimpleORMap
                 }
             }
         }
-        if ($_SERVER['HTTPS'] === 'on' && count($secure_media) > 0) {
+        if (
+            isset($_SERVER['HTTPS'])
+            && $_SERVER['HTTPS'] === 'on'
+            && count($secure_media) > 0
+        ) {
             foreach ($secure_media as $index => $url) {
                 $files[] = [$url, $media_types[$index]];
             }