From: Andrew Garrett Date: Tue, 8 Sep 2009 19:39:04 +0000 (+0000) Subject: Fixes for r55979 X-Git-Tag: 1.31.0-rc.0~39831 X-Git-Url: https://git.cyclocoop.org/%242?a=commitdiff_plain;h=5119ce615c7c94a66fcd0be501d3a6479e5d38aa;p=lhc%2Fweb%2Fwiklou.git 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. --- 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' );