From: Victor Vasiliev Date: Thu, 27 Dec 2007 18:05:40 +0000 (+0000) Subject: * Hide undo link if user can't edit article X-Git-Tag: 1.31.0-rc.0~50258 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/modifier.php?a=commitdiff_plain;h=98e68773b54d5f47c7b10bd717181c69ddd265e2;p=lhc%2Fweb%2Fwiklou.git * Hide undo link if user can't edit article --- 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 ) {