Force redirect headers to use absolute URLs as per spec (though
authorBrion Vibber <brion@users.mediawiki.org>
Mon, 22 Dec 2003 10:21:18 +0000 (10:21 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Mon, 22 Dec 2003 10:21:18 +0000 (10:21 +0000)
browsers seem to accept relative ones); escape the page name
on the login cookie check.

includes/OutputPage.php
includes/SpecialUserlogin.php

index 86038f5..5dd58a6 100644 (file)
@@ -246,6 +246,11 @@ class OutputPage {
                header( "Content-language: {$wgLanguageCode}" );
                
                if ( "" != $this->mRedirect ) {
+                       if( substr( $this->mRedirect, 0, 4 ) != "http" ) {
+                               # Standards require redirect URLs to be absolute
+                               global $wgServer;
+                               $this->mRedirect = $wgServer . $this->mRedirect;
+                       }
                        header( "Location: {$this->mRedirect}" );
                        return;
                }
index 584f810..b18e501 100644 (file)
@@ -386,7 +386,7 @@ $cambutton
 {
        global $wgOut, $wgLang;
 
-       $check = wfLocalUrl( $wgLang->specialPage( "Userlogin" ),
+       $check = wfLocalUrl( wfUrlEncode( $wgLang->specialPage( "Userlogin" ) ),
                         "wpCookieCheck=$type" );
 
        return $wgOut->redirect( $check );