r10516 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r10515‎ | r10516 | r10517 >
Date:03:04, 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:
  • /branches/REL1_5/phase3/includes/SpecialPage.php (modified) (history)

Diff [purge]

Index: branches/REL1_5/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' ),
@@ -75,21 +71,17 @@
7672 'Userrights' => new SpecialPage( 'Userrights', 'userrights' ),
7773 );
7874
79 -global $wgUseValidation ;
8075 if ( $wgUseValidation )
8176 $wgSpecialPages['Validate'] = new SpecialPage( 'Validate' );
8277
83 -global $wgDisableCounters;
8478 if( !$wgDisableCounters ) {
8579 $wgSpecialPages['Popularpages'] = new SpecialPage( 'Popularpages' );
8680 }
8781
88 -global $wgDisableInternalSearch;
8982 if( !$wgDisableInternalSearch ) {
9083 $wgSpecialPages['Search'] = new UnlistedSpecialPage( 'Search' );
9184 }
9285
93 -global $wgEmailAuthentication;
9486 if( $wgEmailAuthentication ) {
9587 $wgSpecialPages['Confirmemail'] = new UnlistedSpecialPage( 'Confirmemail' );
9688 }
@@ -165,7 +157,7 @@
166158 * @static
167159 * @param string $name
168160 */
169 - function &getPage( $name ) {
 161+ function getPage( $name ) {
170162 global $wgSpecialPages;
171163 if ( array_key_exists( $name, $wgSpecialPages ) ) {
172164 return $wgSpecialPages[$name];
@@ -179,7 +171,7 @@
180172 * @param string $name
181173 * @return mixed Title object if the redirect exists, otherwise NULL
182174 */
183 - function &getRedirect( $name ) {
 175+ function getRedirect( $name ) {
184176 global $wgUser;
185177 switch ( $name ) {
186178 case 'Mypage':
@@ -240,12 +232,12 @@
241233 $par = $bits[1];
242234 }
243235
244 - $page =& SpecialPage::getPage( $name );
 236+ $page = SpecialPage::getPage( $name );
245237 if ( is_null( $page ) ) {
246238 if ( $including ) {
247239 return false;
248240 } else {
249 - $redir =& SpecialPage::getRedirect( $name );
 241+ $redir = SpecialPage::getRedirect( $name );
250242 if ( isset( $redir ) ) {
251243 if ( isset( $par ) )
252244 $wgOut->redirect( $redir->getFullURL() . '/' . $par );

Follow-up revisions

RevisionCommit summaryAuthorDate
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
r10514* New special page: SpecialMostlinked...avar02:59, 15 August 2005

Status & tagging log