drop "Application" on second thought (a matter of taste, mostly)
[squirrelmail.git] / src / redirect.php
index cce56c618407f84077859f2762239e3792a32037..bfa88bef29fb2eb8058864169c7c7cc524b0b729 100644 (file)
@@ -129,11 +129,9 @@ $attachment_common_types_parsed = array();
 sqsession_register($attachment_common_types, 'attachment_common_types');
 sqsession_register($attachment_common_types_parsed, 'attachment_common_types_parsed');
 
-$debug = false;
-
 if ( sqgetGlobalVar('HTTP_ACCEPT', $http_accept, SQ_SERVER) &&
     !isset($attachment_common_types_parsed[$http_accept]) ) {
-    attachment_common_parse($http_accept, $debug);
+    attachment_common_parse($http_accept);
 }
 
 /* Complete autodetection of Javascript. */
@@ -151,7 +149,7 @@ if ( sqgetGlobalVar('session_expired_location', $session_expired_location, SQ_SE
             // of the last page
             $redirect_url = $session_expired_location;
         } else {
-            $redirect_url = $location.'/webmail.php?right_frame='.urldecode($session_expired_location);
+            $redirect_url = $location.'/webmail.php?right_frame='.urlencode($session_expired_location);
         }
     }
     unset($session_expired_location);
@@ -169,11 +167,9 @@ exit;
 
 /* --------------------- end main ----------------------- */
 
-function attachment_common_parse($str, $debug) {
+function attachment_common_parse($str) {
     global $attachment_common_types, $attachment_common_types_parsed;
 
-    $attachment_common_types_parsed[$str] = true;
-
     /*
      * Replace ", " with "," and explode on that as Mozilla 1.x seems to
      * use "," to seperate whilst IE, and earlier versions of Mozilla use
@@ -193,4 +189,7 @@ function attachment_common_parse($str, $debug) {
         }
     }
     sqsession_register($attachment_common_types, 'attachment_common_types');
+
+    /* mark as parsed */
+    $attachment_common_types_parsed[$str] = true;
 }