Do the "user is allowed to edit" check when checking for protect rights with the...
authorAlexandre Emsenhuber <ialex@users.mediawiki.org>
Sat, 10 Dec 2011 15:44:44 +0000 (15:44 +0000)
committerAlexandre Emsenhuber <ialex@users.mediawiki.org>
Sat, 10 Dec 2011 15:44:44 +0000 (15:44 +0000)
includes/Title.php

index b7360eb..28589c7 100644 (file)
@@ -1522,7 +1522,7 @@ class Title {
         */
        private function checkActionPermissions( $action, $user, $errors, $doExpensiveQueries, $short ) {
                if ( $action == 'protect' ) {
-                       if ( $this->getUserPermissionsErrors( 'edit', $user ) != array() ) {
+                       if ( count( $this->getUserPermissionsErrorsInternal( 'edit', $user, $doExpensiveQueries, true ) ) ) {
                                // If they can't edit, they shouldn't protect.
                                $errors[] = array( 'protect-cantedit' );
                        }