r111037 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r111036‎ | r111037 | r111038 >
Date:14:46, 9 February 2012
Author:ashley
Status:ok
Tags:nodeploy 
Comment:
Comments: fix bug #34281 -- don't show "reply" links to unprivileged users. Patch by Van de Bugger.
Modified paths:
  • /trunk/extensions/Comments/CommentClass.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Comments/CommentClass.php
@@ -779,13 +779,15 @@
780780
781781 // Reply Link (does not appear on child comments)
782782 $replyRow = '';
783 - if( $comment['Comment_Parent_ID'] == 0 ) {
784 - if( $replyRow ) {
785 - $replyRow .= ' | ';
 783+ if ( $wgUser->isAllowed( 'comment' ) ) {
 784+ if( $comment['Comment_Parent_ID'] == 0 ) {
 785+ if( $replyRow ) {
 786+ $replyRow .= ' | ';
 787+ }
 788+ $replyRow .= " | <a href=\"#end\" rel=\"nofollow\" class=\"comments-reply-to\" data-comment-id=\"{$comment['CommentID']}\" data-comments-safe-username=\"" .
 789+ htmlspecialchars( $CommentReplyTo, ENT_QUOTES ) . '">' .
 790+ wfMsg( 'comment-reply' ) . '</a>';
786791 }
787 - $replyRow .= " | <a href=\"#end\" rel=\"nofollow\" class=\"comments-reply-to\" data-comment-id=\"{$comment['CommentID']}\" data-comments-safe-username=\"" .
788 - htmlspecialchars( $CommentReplyTo, ENT_QUOTES ) . '">' .
789 - wfMsg( 'comment-reply' ) . '</a>';
790792 }
791793
792794 if( $comment['Comment_Parent_ID'] == 0 ) {

Sign-offs

UserFlagDate
Awjrichardsinspected23:45, 17 February 2012

Status & tagging log