r87841 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r87840‎ | r87841 | r87842 >
Date:20:33, 10 May 2011
Author:yaron
Status:deferred
Tags:
Comment:
Added removal of duplicate values for remote autocompletion on category
Modified paths:
  • /trunk/extensions/SemanticForms/includes/SF_Utils.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/includes/SF_Utils.php
@@ -432,6 +432,8 @@
433433 }
434434 // return if we've reached the maximum number of allowed values
435435 if ( count( $pages ) > $sfgMaxAutocompleteValues ) {
 436+ // Remove duplicates, and put in alphabetical order.
 437+ $pages = array_unique( $pages );
436438 sort( $pages );
437439 return $pages;
438440 }
@@ -442,6 +444,8 @@
443445 }
444446 }
445447 if ( count( $newcategories ) == 0 ) {
 448+ // Remove duplicates, and put in alphabetical order.
 449+ $pages = array_unique( $pages );
446450 sort( $pages );
447451 return $pages;
448452 } else {
@@ -449,6 +453,8 @@
450454 }
451455 $checkcategories = array_diff( $newcategories, array() );
452456 }
 457+ // Remove duplicates, and put in alphabetical order.
 458+ $pages = array_unique( $pages );
453459 sort( $pages );
454460 return $pages;
455461 }