Drop some useless parameters to silly methods on the pretty much broken MediaWiki...
authorBrion Vibber <brion@users.mediawiki.org>
Wed, 26 Mar 2008 18:18:24 +0000 (18:18 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Wed, 26 Mar 2008 18:18:24 +0000 (18:18 +0000)
These are just globals, and will never be anything other than the globals, so just use them...
Works around mysterious segfault we started having on some wikis, for no apparent reason, and simplifies ugly code. Sigh.

includes/Wiki.php
index.php
skins/MonoBook.php

index 061d1a9..44c9358 100644 (file)
@@ -92,32 +92,30 @@ class MediaWiki {
         *
         * @param String $title
         * @param String $action
-        * @param OutputPage $output
-        * @param WebRequest $request
-        * @param Language $lang
         * @return Title object to be $wgTitle
         */
-       function checkInitialQueries( $title, $action, &$output, $request, $lang ) {
-               if( $request->getVal( 'printable' ) == 'yes' ){
-                       $output->setPrintable();
+       function checkInitialQueries( $title, $action ) {
+               global $wgOut, $wgRequest, $wgContLang;
+               if( $wgRequest->getVal( 'printable' ) == 'yes' ){
+                       $wgOut->setPrintable();
                }
 
                $ret = NULL;
 
                if ( '' == $title && 'delete' != $action ) {
                        $ret = Title::newMainPage();
-               } elseif ( $curid = $request->getInt( 'curid' ) ) {
+               } elseif ( $curid = $wgRequest->getInt( 'curid' ) ) {
                        # URLs like this are generated by RC, because rc_title isn't always accurate
                        $ret = Title::newFromID( $curid );
                } else {
                        $ret = Title::newFromURL( $title );
                        // check variant links so that interwiki links don't have to worry
                        // about the possible different language variants
-                       if( count( $lang->getVariants() ) > 1 && !is_null( $ret ) && $ret->getArticleID() == 0 )
+                       if( count( $wgContLang->getVariants() ) > 1 && !is_null( $ret ) && $ret->getArticleID() == 0 )
                                $lang->findVariantLink( $title, $ret );
 
                }
-               if ( ( $oldid = $request->getInt( 'oldid' ) )
+               if ( ( $oldid = $wgRequest->getInt( 'oldid' ) )
                        && ( is_null( $ret ) || $ret->getNamespace() != NS_SPECIAL ) ) {
                        // Allow oldid to override a changed or missing title.
                        $rev = Revision::newFromId( $oldid );
index 4ff111b..c7432e4 100644 (file)
--- a/index.php
+++ b/index.php
@@ -56,7 +56,7 @@ if ( !is_null( $maxLag ) ) {
 $action = $wgRequest->getVal( 'action', 'view' );
 $title = $wgRequest->getVal( 'title' );
 
-$wgTitle = $mediaWiki->checkInitialQueries( $title, $action, $wgOut, $wgRequest, $wgContLang );
+$wgTitle = $mediaWiki->checkInitialQueries( $title, $action );
 if ($wgTitle == NULL) {
        unset( $wgTitle );
 }
index 4774e20..389cb14 100644 (file)
@@ -174,6 +174,11 @@ class MonoBookTemplate extends QuickTemplate {
                        </div></form>
                </div>
        </div>
+    <?php
+      if(isset($GLOBALS['wgSpecialPages']['Collection'])) {
+         Collection::printPortlet();
+      }
+    ?>
        <div class="portlet" id="p-tb">
                <h5><?php $this->msg('toolbox') ?></h5>
                <div class="pBody">