From 98e68773b54d5f47c7b10bd717181c69ddd265e2 Mon Sep 17 00:00:00 2001 From: Victor Vasiliev Date: Thu, 27 Dec 2007 18:05:40 +0000 Subject: [PATCH] * Hide undo link if user can't edit article --- RELEASE-NOTES | 1 + includes/PageHistory.php | 14 ++++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index a40d1a29ea..0eba7fb022 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -267,6 +267,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 12371) Handle more namespace case variants in namespaceDupes.php * (bug 12380) Bot-friendly EditPage::spamPage * (bug 8066) Spaces can't be entered in special page aliases +* Hide undo link if user can't edit article == Parser changes in 1.12 == diff --git a/includes/PageHistory.php b/includes/PageHistory.php index d2da47a5eb..9d8466528d 100644 --- a/includes/PageHistory.php +++ b/includes/PageHistory.php @@ -267,12 +267,14 @@ class PageHistory { . ''; } - $undolink = $this->mSkin->makeKnownLinkObj( - $this->mTitle, - wfMsgHtml( 'editundo' ), - 'action=edit&undoafter=' . $next->rev_id . '&undo=' . $rev->getId() - ); - $tools[] = "{$undolink}"; + if( $this->mTitle->quickUserCan( 'edit' ) ) { + $undolink = $this->mSkin->makeKnownLinkObj( + $this->mTitle, + wfMsgHtml( 'editundo' ), + 'action=edit&undoafter=' . $next->rev_id . '&undo=' . $rev->getId() + ); + $tools[] = "{$undolink}"; + } } if( $tools ) { -- 2.20.1