diff --git a/include/class.misc.php b/include/class.misc.php
index 056923766b36996da6a6813a008111868f6f029f..086de355654ae9f02f21b05f8a286c8a6b5fbb06 100644
--- a/include/class.misc.php
+++ b/include/class.misc.php
@@ -230,7 +230,7 @@ class Misc {
     function currentURL() {
 
         $str = 'http';
-        if ($_SERVER['HTTPS'] == 'on') {
+        if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') {
             $str .='s';
         }
         $str .= '://';