From 2b552852e355d3f356f15cb14c687e85b8c2b41e Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Mon, 7 Nov 2011 13:51:40 +0000 Subject: [PATCH] * 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() --- includes/OutputPage.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 0a81ecd9c5..8d17e8bc2c 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -2841,9 +2841,10 @@ $templates } # Universal edit button - if ( $wgUniversalEditButton ) { - if ( $this->isArticleRelated() && $this->getTitle() && $this->getTitle()->quickUserCan( 'edit' ) - && ( $this->getTitle()->exists() || $this->getTitle()->quickUserCan( 'create' ) ) ) { + if ( $wgUniversalEditButton && $this->isArticleRelated() ) { + $user = $this->getUser(); + if ( $this->getTitle()->quickUserCan( 'edit', $user ) + && ( $this->getTitle()->exists() || $this->getTitle()->quickUserCan( 'create', $user ) ) ) { // Original UniversalEditButton $msg = $this->msg( 'edit' )->text(); $tags[] = Html::element( 'link', array( -- 2.20.1