Sfoglia il codice sorgente

HTTP/1.1-compliant redirecting

Thijs Kinkhorst 22 anni fa
parent
commit
3dcd2f360a
4 ha cambiato i file con 8 aggiunte e 6 eliminazioni
  1. 1 1
      src/mailto.php
  2. 1 1
      src/options_highlight.php
  3. 1 1
      src/options_identities.php
  4. 5 3
      src/redirect.php

+ 1 - 1
src/mailto.php

@@ -69,5 +69,5 @@ $url = urlencode($url);
 /* $redirect .= $url; */
 $redirect = 'login.php?mailto=' . $url;
 session_write_close();
-header('Location: ' . $redirect);
+header('Location: ' .get_location(). $redirect);
 ?>

+ 1 - 1
src/options_highlight.php

@@ -97,7 +97,7 @@ if (isset($theid) && ($action == 'delete') ||
 
     setPref($data_dir, $username, 'hililist', serialize($message_highlight_list));
 
-    header( 'Location: options_highlight.php' );
+    header( 'Location: ' .get_location(). '/options_highlight.php' );
     exit;
 } else if ($action == 'save') {
 

+ 1 - 1
src/options_identities.php

@@ -32,7 +32,7 @@ if (!empty($_POST)) {
 
     if (isset($return)) {
        SaveUpdateFunction();
-       header('Location: options_personal.php');
+       header('Location: '.get_location().'/options_personal.php');
        exit();
     }
     

+ 5 - 3
src/redirect.php

@@ -138,20 +138,22 @@ if ($javascript_setting != SMPREF_JS_ON){
 setPref($data_dir, $username, 'javascript_on', $js_pref);
 
 /* Compute the URL to forward the user to. */
-$redirect_url = 'webmail.php';
+$redirect_url = $location . '/webmail.php';
 
 if ( sqgetGlobalVar('session_expired_location', $session_expired_location, SQ_SESSION) ) {
     sqsession_unregister('session_expired_location');
     $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
+        // of the last page
         $redirect_url = $session_expired_location;
     } elseif ( strpos($session_expired_location, 'webmail.php') === FALSE ) {
-        $redirect_url = 'webmail.php?right_frame='.urldecode($session_expired_location);
+        $redirect_url = $location.'/webmail.php?right_frame='.urldecode($session_expired_location);
     }
     unset($session_expired_location);
 }
 if($mailto != '') {
-    $redirect_url  = 'webmail.php?right_frame=compose.php&mailto=';
+    $redirect_url  = $location . '/webmail.php?right_frame=compose.php&mailto=';
     $redirect_url .= $mailto;
 }