Cleanup updateRestrictions() some
authorAaron Schulz <aaron@users.mediawiki.org>
Tue, 9 Dec 2008 22:12:29 +0000 (22:12 +0000)
committerAaron Schulz <aaron@users.mediawiki.org>
Tue, 9 Dec 2008 22:12:29 +0000 (22:12 +0000)
includes/Article.php

index bb1d7a0..7193904 100644 (file)
@@ -1837,7 +1837,7 @@ class Article {
                global $wgUser, $wgRestrictionTypes, $wgContLang;
 
                $id = $this->mTitle->getArticleID();
-               if( array() != $this->mTitle->getUserPermissionsErrors( 'protect', $wgUser ) || wfReadOnly() || $id == 0 ) {
+               if( $id <= 0 || wfReadOnly() || !$this->mTitle->userCan('protect') ) {
                        return false;
                }