r10514 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r10513‎ | r10514 | r10515 >
Date:02:59, 15 August 2005
Author:avar
Status:old
Tags:
Comment:
* New special page: SpecialMostlinked
* Removed redundant global declerations, the variables are in the same scope
* (bug 2885, 2931) Can't pass a literal as a reference
Modified paths:
  • /trunk/phase3/includes/SpecialPage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/SpecialPage.php
@@ -17,11 +17,6 @@
1818
1919
2020 /**
21 - *
22 - */
23 -global $wgSpecialPages, $wgUser;
24 -
25 -/**
2621 * @access private
2722 */
2823 $wgSpecialPages = array(
@@ -47,6 +42,7 @@
4843 'Unusedcategories' => new SpecialPage( 'Unusedcategories' ),
4944 'Unusedimages' => new SpecialPage( 'Unusedimages' ),
5045 'Wantedpages' => new SpecialPage( 'Wantedpages' ),
 46+ 'Mostlinked' => new SpecialPage( 'Mostlinked' ),
5147 'Shortpages' => new SpecialPage( 'Shortpages' ),
5248 'Longpages' => new SpecialPage( 'Longpages' ),
5349 'Newpages' => new IncludableSpecialPage( 'Newpages' ),
@@ -76,21 +72,17 @@
7773 'Userrights' => new SpecialPage( 'Userrights', 'userrights' ),
7874 );
7975
80 -global $wgUseValidation ;
8176 if ( $wgUseValidation )
8277 $wgSpecialPages['Validate'] = new SpecialPage( 'Validate' );
8378
84 -global $wgDisableCounters;
8579 if( !$wgDisableCounters ) {
8680 $wgSpecialPages['Popularpages'] = new SpecialPage( 'Popularpages' );
8781 }
8882
89 -global $wgDisableInternalSearch;
9083 if( !$wgDisableInternalSearch ) {
9184 $wgSpecialPages['Search'] = new UnlistedSpecialPage( 'Search' );
9285 }
9386
94 -global $wgEmailAuthentication;
9587 if( $wgEmailAuthentication ) {
9688 $wgSpecialPages['Confirmemail'] = new UnlistedSpecialPage( 'Confirmemail' );
9789 }
@@ -166,7 +158,7 @@
167159 * @static
168160 * @param string $name
169161 */
170 - function &getPage( $name ) {
 162+ function getPage( $name ) {
171163 global $wgSpecialPages;
172164 if ( array_key_exists( $name, $wgSpecialPages ) ) {
173165 return $wgSpecialPages[$name];
@@ -180,7 +172,7 @@
181173 * @param string $name
182174 * @return mixed Title object if the redirect exists, otherwise NULL
183175 */
184 - function &getRedirect( $name ) {
 176+ function getRedirect( $name ) {
185177 global $wgUser;
186178 switch ( $name ) {
187179 case 'Mypage':
@@ -241,12 +233,12 @@
242234 $par = $bits[1];
243235 }
244236
245 - $page =& SpecialPage::getPage( $name );
 237+ $page = SpecialPage::getPage( $name );
246238 if ( is_null( $page ) ) {
247239 if ( $including ) {
248240 return false;
249241 } else {
250 - $redir =& SpecialPage::getRedirect( $name );
 242+ $redir = SpecialPage::getRedirect( $name );
251243 if ( isset( $redir ) ) {
252244 if ( isset( $par ) )
253245 $wgOut->redirect( $redir->getFullURL() . '/' . $par );

Follow-up revisions

RevisionCommit summaryAuthorDate
r10516* New special page: SpecialMostlinked...avar03:04, 15 August 2005
r10521* (bug 2885, 2931) Bah, bugs with the thingalabong 4.4.0, 5.1 eep!avar12:07, 15 August 2005
r10819* (bug 2885) More PHP 5.1 fixes: skin, search, log, undeletevibber21:58, 28 August 2005
r10820* (bug 2885) More PHP 5.1 fixes: skin, search, log, undeletevibber21:59, 28 August 2005
r11577* (bug 2885) Remove unnecessary reference parameter which broke classic skin...vibber01:30, 30 October 2005
r11578* (bug 2885) Remove unnecessary reference parameter which broke classic skin...vibber01:30, 30 October 2005

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r10239* (bug 2885) Fix fatal errors and notices in PHP 5.1.0beta3...vibber11:29, 22 July 2005
r10316* (bug 2885, 2931) Problems with references in php 4.4 and 5.1avar19:47, 30 July 2005

Status & tagging log