(bug 17790) Users instantly logged off on HughesNet
[lhc/web/wiklou.git] / includes / specials / SpecialUserlogout.php
index 3d497bd..28f8a5e 100644 (file)
 function wfSpecialUserlogout() {
        global $wgUser, $wgOut;
 
+       /**
+        * Some satellite ISPs use broken precaching schemes that log people out straight after
+        * they're logged in (bug 17790). Luckily, there's a way to detect such requests.
+        */
+       wfDebug( $_SERVER['REQUEST_URI'] . "\n" );
+       if ( isset( $_SERVER['REQUEST_URI'] ) && strpos( $_SERVER['REQUEST_URI'], '&' ) !== false ) {
+               wfHttpError( 400, wfMsg( 'loginerror' ), wfMsg( 'suspicious-userlogout' ) );
+               return;
+       }
+       
        $oldName = $wgUser->getName();
        $wgUser->logout();
        $wgOut->setRobotPolicy( 'noindex,nofollow' );