r87185 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r87184‎ | r87185 | r87186 >
Date:13:18, 1 May 2011
Author:krinkle
Status:ok
Tags:
Comment:
(bug 28737) inArray returns the index if found (can also be 0), or -1 if not found
Modified paths:
  • /trunk/extensions/ArticleFeedback/modules/ext.articleFeedback/ext.articleFeedback.js (modified) (history)

Diff [purge]

Index: trunk/extensions/ArticleFeedback/modules/ext.articleFeedback/ext.articleFeedback.js
@@ -280,7 +280,7 @@
281281 var groups = mw.config.get( 'wgUserGroups' );
282282 // Verify that each restriction exists in the user's groups
283283 for ( var i = 0; i < restrictions.length; i++ ) {
284 - if ( !$.inArray( restrictions[i], groups ) ) {
 284+ if ( $.inArray( restrictions[i], groups ) < 0 ) {
285285 return false;
286286 }
287287 }

Status & tagging log