Pass the local User object to Revision::userCan()
authorAlexandre Emsenhuber <ialex.wiki@gmail.com>
Mon, 16 Jul 2012 09:03:02 +0000 (11:03 +0200)
committerAntoine Musso <hashar@free.fr>
Tue, 24 Jul 2012 16:28:03 +0000 (18:28 +0200)
Change-Id: Iffd857a577593642464371a988b7b7829d246748

includes/Article.php

index 3b259e2..18ca077 100644 (file)
@@ -1075,8 +1075,9 @@ class Article extends Page {
                }
 
                $outputPage = $this->getContext()->getOutput();
+               $user = $this->getContext()->getUser();
                // If the user is not allowed to see it...
-               if ( !$this->mRevision->userCan( Revision::DELETED_TEXT ) ) {
+               if ( !$this->mRevision->userCan( Revision::DELETED_TEXT, $user ) ) {
                        $outputPage->wrapWikiMsg( "<div class='mw-warning plainlinks'>\n$1\n</div>\n",
                                'rev-deleted-text-permission' );