ashley | 15 Jul 2012 18:14
Picon
Favicon

[MediaWiki-commits] SVN: [115613] trunk/extensions/Comments/Comments_AjaxFunctions.php

https://www.mediawiki.org/wiki/Special:Code/MediaWiki/115613

Revision: 115613
Author:   ashley
Date:     2012-07-15 16:14:56 +0000 (Sun, 15 Jul 2012)
Log Message:
-----------
Comments: bug #34303 -- check for the 'comment' user right, in addition to block status, in the AJAX
functions. Based on Van de Bugger's patch.

Modified Paths:
--------------
    trunk/extensions/Comments/Comments_AjaxFunctions.php

Modified: trunk/extensions/Comments/Comments_AjaxFunctions.php
===================================================================
--- trunk/extensions/Comments/Comments_AjaxFunctions.php	2012-07-15 12:36:56 UTC (rev 115612)
+++ trunk/extensions/Comments/Comments_AjaxFunctions.php	2012-07-15 16:14:56 UTC (rev 115613)
 <at>  <at>  -7,8 +7,9  <at>  <at> 
 function wfCommentSubmit( $page_id, $parent_id, $comment_text ) {
 	global $wgUser;

-	// Blocked users cannot submit new comments
-	if( $wgUser->isBlocked() ) {
+	// Blocked users cannot submit new comments, and neither can those users
+	// without the necessary privileges
+	if( $wgUser->isBlocked() || !$wgUser->isAllowed( 'comment' ) ) {
 		return '';
 	}

(Continue reading)


Gmane