r93367 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r93366‎ | r93367 | r93368 >
Date:06:11, 28 July 2011
Author:nikerabbit
Status:ok
Tags:
Comment:
Fu r93249 failed grepping
Modified paths:
  • /trunk/phase3/includes/SpecialPageFactory.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/SpecialPageFactory.php
@@ -267,7 +267,7 @@
268268 */
269269 public static function setGroup( $page, $group ) {
270270 global $wgSpecialPageGroups;
271 - $name = is_object( $page ) ? $page->mName : $page;
 271+ $name = is_object( $page ) ? $page->getName() : $page;
272272 $wgSpecialPageGroups[$name] = $group;
273273 }
274274
@@ -277,23 +277,25 @@
278278 * @param $page SpecialPage
279279 */
280280 public static function getGroup( &$page ) {
 281+ $name = $page->getName();
 282+
281283 global $wgSpecialPageGroups;
282284 static $specialPageGroupsCache = array();
283 - if ( isset( $specialPageGroupsCache[$page->mName] ) ) {
284 - return $specialPageGroupsCache[$page->mName];
 285+ if ( isset( $specialPageGroupsCache[$name] ) ) {
 286+ return $specialPageGroupsCache[$name];
285287 }
286 - $msg = wfMessage( 'specialpages-specialpagegroup-' . strtolower( $page->mName ) );
 288+ $msg = wfMessage( 'specialpages-specialpagegroup-' . strtolower( $name ) );
287289 if ( !$msg->isBlank() ) {
288290 $group = $msg->text();
289291 } else {
290 - $group = isset( $wgSpecialPageGroups[$page->mName] )
291 - ? $wgSpecialPageGroups[$page->mName]
 292+ $group = isset( $wgSpecialPageGroups[$name] )
 293+ ? $wgSpecialPageGroups[$name]
292294 : '-';
293295 }
294296 if ( $group == '-' ) {
295297 $group = 'other';
296298 }
297 - $specialPageGroupsCache[$page->mName] = $group;
 299+ $specialPageGroupsCache[$name] = $group;
298300 return $group;
299301 }
300302

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r93249makes SpecialPage::mName explicitly private...hashar21:30, 26 July 2011

Status & tagging log