Delete more thumbnails after parser tests.
[lhc/web/wiklou.git] / includes / Wiki.php
index 4b84744..e6ccbe5 100644 (file)
@@ -62,7 +62,6 @@ class MediaWiki {
                }
 
                $this->context = $context;
-               $this->context->setTitle( $this->parseTitle() );
        }
 
        /**
@@ -170,6 +169,7 @@ class MediaWiki {
         * - special pages
         * - normal pages
         *
+        * @throws MWException|PermissionsError|BadTitleError|HttpError
         * @return void
         */
        private function performRequest() {
@@ -491,6 +491,23 @@ class MediaWiki {
 
                $request = $this->context->getRequest();
 
+               if ( $request->getCookie( 'forceHTTPS' )
+                       && $request->detectProtocol() == 'http'
+                       && $request->getMethod() == 'GET'
+               ) {
+                       $redirUrl = $request->getFullRequestURL();
+                       $redirUrl = str_replace( 'http://' , 'https://' , $redirUrl );
+
+                       // Setup dummy Title, otherwise OutputPage::redirect will fail
+                       $title = Title::newFromText( NS_MAIN, 'REDIR' );
+                       $this->context->setTitle( $title );
+                       $output = $this->context->getOutput();
+                       $output->redirect( $redirUrl );
+                       $output->output();
+                       wfProfileOut( __METHOD__ );
+                       return;
+               }
+
                // Send Ajax requests to the Ajax dispatcher.
                if ( $wgUseAjax && $request->getVal( 'action', 'view' ) == 'ajax' ) {