Updating use of sqgetGlobalVar.
[squirrelmail.git] / functions / mime.php
index fdd6da537662858e51a06651bee682138d4f7072..32fafaaae98b0197e30ee84498b9d021032d9db0 100644 (file)
@@ -359,11 +359,9 @@ function formatBody($imap_stream, $message, $color, $wrap_at, $ent_num, $id, $ma
     // workaround for not updated config.php
     if (! isset($use_iframe)) $use_iframe = false;
 
-    // If there's no "view_unsafe_images" setting in the user's preferences,
-    // turn unsafe images off by default.
-    if( !sqgetGlobalVar('view_unsafe_images', $view_unsafe_images, SQ_GET) ) {
-        $view_unsafe_images = false;
-    }
+    // If there's no "view_unsafe_images" variable in the URL, turn unsafe
+    // images off by default.
+    sqgetGlobalVar('view_unsafe_images', $view_unsafe_images, SQ_GET, FALSE);
 
     $body = '';
     $urlmailbox = urlencode($mailbox);
@@ -1854,11 +1852,10 @@ function sq_fix_url($attname, &$attvalue, $message, $id, $mailbox,$sQuote = '"')
         $attvalue = trim(substr($attvalue,1,-1));
     }
 
-    // If there's no "view_unsafe_images" setting in the user's preferences,
-    // turn unsafe images off by default.
-    if( !sqgetGlobalVar('view_unsafe_images', $view_unsafe_images, SQ_GET) ) {
-        $view_unsafe_images = false;
-    }
+    // If there's no "view_unsafe_images" variable in the URL, turn unsafe
+    // images off by default.
+    sqgetGlobalVar('view_unsafe_images', $view_unsafe_images, SQ_GET, FALSE);
+
     $secremoveimg = '../images/' . _("sec_remove_eng.png");
 
     /**
@@ -2497,11 +2494,9 @@ function magicHTML($body, $id, $message, $mailbox = 'INBOX', $take_mailto_links
             )
         );
 
-    // If there's no "view_unsafe_images" setting in the user's preferences,
-    // turn unsafe images off by default.
-    if( !sqgetGlobalVar('view_unsafe_images', $view_unsafe_images, SQ_GET) ) {
-        $view_unsafe_images = false;
-    }
+    // If there's no "view_unsafe_images" variable in the URL, turn unsafe
+    // images off by default.
+    sqgetGlobalVar('view_unsafe_images', $view_unsafe_images, SQ_GET, FALSE);
 
     if (!$view_unsafe_images){
         /**