From 5119ce615c7c94a66fcd0be501d3a6479e5d38aa Mon Sep 17 00:00:00 2001 From: Andrew Garrett Date: Tue, 8 Sep 2009 19:39:04 +0000 Subject: [PATCH] Fixes for r55979 * Use getUserPermissionsErrors, which also handles blocking and so on. * Also check with create action, which also checks for title protection and what-not. --- includes/Article.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/includes/Article.php b/includes/Article.php index 85a331e87d..efc3961066 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -1199,7 +1199,7 @@ class Article { * namespace, show the default message text. To be called from Article::view(). */ public function showMissingArticle() { - global $wgOut, $wgRequest; + global $wgOut, $wgRequest, $wgUser; # Show delete and move logs $this->showLogs(); @@ -1213,7 +1213,11 @@ class Article { // Use the default message text $text = $this->getContent(); } else { - if ( $this->mTitle->userCan( 'edit' ) ) + $createErrors = $this->mTitle->getUserPermissionsErrors( 'create', $wgUser ); + $editErrors = $this->mTitle->getUserPermissionsErrors( 'edit', $wgUser ); + $errors = array_merge( $createErrors, $editErrors ); + + if ( !count($errors) ) $text = wfMsgNoTrans( 'noarticletext' ); else $text = wfMsgNoTrans( 'noarticletext-nopermission' ); -- 2.20.1