r102282 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r102281‎ | r102282 | r102283 >
Date:13:51, 7 November 2011
Author:ialex
Status:ok
Tags:
Comment:
* Removed existence of Title object check since not having it would make other things crash in the same function
* Moved isArticleRelated() check one level up
* And pass the User object to Title::quickUserCan()
Modified paths:
  • /trunk/phase3/includes/OutputPage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/OutputPage.php
@@ -2841,9 +2841,10 @@
28422842 }
28432843
28442844 # Universal edit button
2845 - if ( $wgUniversalEditButton ) {
2846 - if ( $this->isArticleRelated() && $this->getTitle() && $this->getTitle()->quickUserCan( 'edit' )
2847 - && ( $this->getTitle()->exists() || $this->getTitle()->quickUserCan( 'create' ) ) ) {
 2845+ if ( $wgUniversalEditButton && $this->isArticleRelated() ) {
 2846+ $user = $this->getUser();
 2847+ if ( $this->getTitle()->quickUserCan( 'edit', $user )
 2848+ && ( $this->getTitle()->exists() || $this->getTitle()->quickUserCan( 'create', $user ) ) ) {
28482849 // Original UniversalEditButton
28492850 $msg = $this->msg( 'edit' )->text();
28502851 $tags[] = Html::element( 'link', array(

Status & tagging log