* @version $Id$
* @package squirrelmail
*/
-$sInitLocation = 'redirect';
+
+/** This is the redirect page */
+define('PAGE_NAME', 'redirect');
/**
* Include the SquirrelMail initialization file.
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. */
if ( sqgetGlobalVar('session_expired_location', $session_expired_location, SQ_SESSION) ) {
sqsession_unregister('session_expired_location');
- if ( strpos($session_expired_location, 'compose.php') !== FALSE ) {
+ if ( $session_expired_location == 'compose' ) {
$compose_new_win = getPref($data_dir, $username, 'compose_new_win', 0);
if ($compose_new_win) {
- // do not prefix $location here because $session_expired_location is set to PHP_SELF
+ // do not prefix $location here because $session_expired_location is set to the PAGE_NAME
// of the last page
- $redirect_url = $session_expired_location;
+ $redirect_url = $session_expired_location.'.php';
} else {
- $redirect_url = $location.'/webmail.php?right_frame='.urldecode($session_expired_location);
+ $redirect_url = $location.'/webmail.php?right_frame='.urlencode($session_expired_location).'php';
}
}
unset($session_expired_location);
/* --------------------- 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
}
}
sqsession_register($attachment_common_types, 'attachment_common_types');
+
+ /* mark as parsed */
+ $attachment_common_types_parsed[$str] = true;
}