]> scripts.mit.edu Git - autoinstallsdev/mediawiki.git/blobdiff - includes/OutputPage.php
MediaWiki 1.17.3
[autoinstallsdev/mediawiki.git] / includes / OutputPage.php
index 6ecc2754636b7b85303f0796f25e43b15b561dff..207af21de4594531a80726b6a7584b08a367301b 100644 (file)
@@ -1940,7 +1940,7 @@ class OutputPage {
         * Produce the stock "please login to use the wiki" page
         */
        public function loginToUse() {
-               global $wgUser;
+               global $wgUser, $wgRequest;
 
                if( $wgUser->isLoggedIn() ) {
                        $this->permissionRequired( 'read' );
@@ -1954,12 +1954,18 @@ class OutputPage {
                $this->setRobotPolicy( 'noindex,nofollow' );
                $this->setArticleFlag( false );
 
+               $returnto = Title::newFromURL( $wgRequest->getVal( 'title', '' ) );
+               $returntoquery = array();
+               if( $returnto ) {
+                       $returntoquery = array( 'returnto' => $returnto->getPrefixedText() );
+               }
+
                $loginTitle = SpecialPage::getTitleFor( 'Userlogin' );
                $loginLink = $skin->link(
                        $loginTitle,
                        wfMsgHtml( 'loginreqlink' ),
                        array(),
-                       array( 'returnto' => $this->getTitle()->getPrefixedText() ),
+                       $returntoquery,
                        array( 'known', 'noclasses' )
                );
                $this->addHTML( wfMsgWikiHtml( 'loginreqpagetext', $loginLink ) );
@@ -2334,8 +2340,7 @@ class OutputPage {
         * @return string html <script> and <style> tags
         */
        protected function makeResourceLoaderLink( Skin $skin, $modules, $only, $useESI = false ) {
-               global $wgUser, $wgLang, $wgLoadScript, $wgResourceLoaderUseESI,
-                       $wgResourceLoaderInlinePrivateModules, $wgRequest;
+               global $wgUser, $wgLang, $wgLoadScript, $wgResourceLoaderUseESI, $wgRequest;
                // Lazy-load ResourceLoader
                // TODO: Should this be a static function of ResourceLoader instead?
                $baseQuery = array(
@@ -2408,8 +2413,11 @@ class OutputPage {
                        
                        $query['modules'] = ResourceLoader::makePackedModulesString( array_keys( $modules ) );
                        
-                       // Support inlining of private modules if configured as such
-                       if ( $group === 'private' && $wgResourceLoaderInlinePrivateModules ) {
+                       // Inline private modules. These can't be loaded through load.php for security
+                       // reasons, see bug 34907. Note that these modules should be loaded from
+                       // getHeadScripts() before the first loader call. Otherwise other modules can't
+                       // properly use them as dependencies (bug 30914)
+                       if ( $group === 'private' ) {
                                if ( $only == 'styles' ) {
                                        $links .= Html::inlineStyle(
                                                $resourceLoader->makeModuleResponse( $context, $modules )