Index: trunk/extensions/SemanticForms/includes/SF_Utils.php |
— | — | @@ -432,6 +432,8 @@ |
433 | 433 | } |
434 | 434 | // return if we've reached the maximum number of allowed values |
435 | 435 | if ( count( $pages ) > $sfgMaxAutocompleteValues ) { |
| 436 | + // Remove duplicates, and put in alphabetical order. |
| 437 | + $pages = array_unique( $pages ); |
436 | 438 | sort( $pages ); |
437 | 439 | return $pages; |
438 | 440 | } |
— | — | @@ -442,6 +444,8 @@ |
443 | 445 | } |
444 | 446 | } |
445 | 447 | if ( count( $newcategories ) == 0 ) { |
| 448 | + // Remove duplicates, and put in alphabetical order. |
| 449 | + $pages = array_unique( $pages ); |
446 | 450 | sort( $pages ); |
447 | 451 | return $pages; |
448 | 452 | } else { |
— | — | @@ -449,6 +453,8 @@ |
450 | 454 | } |
451 | 455 | $checkcategories = array_diff( $newcategories, array() ); |
452 | 456 | } |
| 457 | + // Remove duplicates, and put in alphabetical order. |
| 458 | + $pages = array_unique( $pages ); |
453 | 459 | sort( $pages ); |
454 | 460 | return $pages; |
455 | 461 | } |