r32477 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r32476‎ | r32477 | r32478 >
Date:18:18, 26 March 2008
Author:brion
Status:old
Tags:
Comment:
Drop some useless parameters to silly methods on the pretty much broken MediaWiki object.
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.
Modified paths:
  • /trunk/phase3/includes/Wiki.php (modified) (history)
  • /trunk/phase3/index.php (modified) (history)
  • /trunk/phase3/skins/MonoBook.php (modified) (history)

Diff [purge]

Index: trunk/phase3/skins/MonoBook.php
@@ -174,6 +174,11 @@
175175 </div></form>
176176 </div>
177177 </div>
 178+ <?php
 179+ if(isset($GLOBALS['wgSpecialPages']['Collection'])) {
 180+ Collection::printPortlet();
 181+ }
 182+ ?>
178183 <div class="portlet" id="p-tb">
179184 <h5><?php $this->msg('toolbox') ?></h5>
180185 <div class="pBody">
Index: trunk/phase3/includes/Wiki.php
@@ -92,32 +92,30 @@
9393 *
9494 * @param String $title
9595 * @param String $action
96 - * @param OutputPage $output
97 - * @param WebRequest $request
98 - * @param Language $lang
9996 * @return Title object to be $wgTitle
10097 */
101 - function checkInitialQueries( $title, $action, &$output, $request, $lang ) {
102 - if( $request->getVal( 'printable' ) == 'yes' ){
103 - $output->setPrintable();
 98+ function checkInitialQueries( $title, $action ) {
 99+ global $wgOut, $wgRequest, $wgContLang;
 100+ if( $wgRequest->getVal( 'printable' ) == 'yes' ){
 101+ $wgOut->setPrintable();
104102 }
105103
106104 $ret = NULL;
107105
108106 if ( '' == $title && 'delete' != $action ) {
109107 $ret = Title::newMainPage();
110 - } elseif ( $curid = $request->getInt( 'curid' ) ) {
 108+ } elseif ( $curid = $wgRequest->getInt( 'curid' ) ) {
111109 # URLs like this are generated by RC, because rc_title isn't always accurate
112110 $ret = Title::newFromID( $curid );
113111 } else {
114112 $ret = Title::newFromURL( $title );
115113 // check variant links so that interwiki links don't have to worry
116114 // about the possible different language variants
117 - if( count( $lang->getVariants() ) > 1 && !is_null( $ret ) && $ret->getArticleID() == 0 )
 115+ if( count( $wgContLang->getVariants() ) > 1 && !is_null( $ret ) && $ret->getArticleID() == 0 )
118116 $lang->findVariantLink( $title, $ret );
119117
120118 }
121 - if ( ( $oldid = $request->getInt( 'oldid' ) )
 119+ if ( ( $oldid = $wgRequest->getInt( 'oldid' ) )
122120 && ( is_null( $ret ) || $ret->getNamespace() != NS_SPECIAL ) ) {
123121 // Allow oldid to override a changed or missing title.
124122 $rev = Revision::newFromId( $oldid );
Index: trunk/phase3/index.php
@@ -56,7 +56,7 @@
5757 $action = $wgRequest->getVal( 'action', 'view' );
5858 $title = $wgRequest->getVal( 'title' );
5959
60 -$wgTitle = $mediaWiki->checkInitialQueries( $title, $action, $wgOut, $wgRequest, $wgContLang );
 60+$wgTitle = $mediaWiki->checkInitialQueries( $title, $action );
6161 if ($wgTitle == NULL) {
6262 unset( $wgTitle );
6363 }

Status & tagging log