From 72b54dbf966e177f2d7922d60ad222569492304b Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Thu, 31 May 2012 10:03:46 +0200 Subject: [PATCH] For consistency of the interface, don't do expensive checks on page view. Change-Id: I4dfda5e286d5d78965469410f39504a211624dee --- includes/Article.php | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/includes/Article.php b/includes/Article.php index ded8c497f2..4b67ea7143 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -1050,16 +1050,12 @@ class Article extends Page { } elseif ( $this->getTitle()->getNamespace() === NS_MEDIAWIKI ) { // Use the default message text $text = $this->getTitle()->getDefaultMessageText(); + } elseif ( $this->getTitle()->quickUserCan( 'create', $this->getContext()->getUser() ) + && $this->getTitle()->quickUserCan( 'edit', $this->getContext()->getUser() ) + ) { + $text = wfMsgNoTrans( 'noarticletext' ); } else { - $createErrors = $this->getTitle()->getUserPermissionsErrors( 'create', $this->getContext()->getUser() ); - $editErrors = $this->getTitle()->getUserPermissionsErrors( 'edit', $this->getContext()->getUser() ); - $errors = array_merge( $createErrors, $editErrors ); - - if ( !count( $errors ) ) { - $text = wfMsgNoTrans( 'noarticletext' ); - } else { - $text = wfMsgNoTrans( 'noarticletext-nopermission' ); - } + $text = wfMsgNoTrans( 'noarticletext-nopermission' ); } $text = "
\n$text\n
"; -- 2.20.1