Index: trunk/phase3/includes/parser/CoreParserFunctions.php |
— | — | @@ -678,24 +678,27 @@ |
679 | 679 | /** |
680 | 680 | * @param $parser Parser |
681 | 681 | * @param $text String The sortkey to use |
682 | | - * @param $arg String Either "noreplace" or "noerror" |
| 682 | + * @param $uarg String Either "noreplace" or "noerror" (in en) |
683 | 683 | * both suppress errors, and noreplace does nothing if |
684 | 684 | * a default sortkey already exists. |
685 | 685 | * @return string |
686 | 686 | */ |
687 | | - public static function defaultsort( $parser, $text, $arg = '' ) { |
| 687 | + public static function defaultsort( $parser, $text, $uarg = '' ) { |
| 688 | + static $magicWords = null; |
| 689 | + if ( is_null( $magicWords ) ) { |
| 690 | + $magicWords = new MagicWordArray( array( 'defaultsort_noerror', 'defaultsort_noreplace' ) ); |
| 691 | + } |
| 692 | + $arg = $magicWords->matchStartToEnd( $uarg ); |
| 693 | + |
688 | 694 | $text = trim( $text ); |
689 | | - $arg = trim( strtolower( $arg ) ); |
690 | 695 | if( strlen( $text ) == 0 ) |
691 | 696 | return ''; |
692 | 697 | $old = $parser->getCustomDefaultSort(); |
693 | | - if ( $old === false || $arg !== 'noreplace' ) { |
| 698 | + if ( $old === false || $arg !== 'defaultsort_noreplace' ) { |
694 | 699 | $parser->setDefaultSort( $text ); |
695 | 700 | } |
696 | 701 | |
697 | | - if( $old === false || $old == $text || $arg === 'noreplace' |
698 | | - || $arg === 'noerror' ) |
699 | | - { |
| 702 | + if( $old === false || $old == $text || $arg ) { |
700 | 703 | return ''; |
701 | 704 | } else { |
702 | 705 | return( '<span class="error">' . |
Index: trunk/phase3/languages/messages/MessagesEn.php |
— | — | @@ -350,6 +350,8 @@ |
351 | 351 | 'url_path' => array( 0, 'PATH' ), |
352 | 352 | 'url_wiki' => array( 0, 'WIKI' ), |
353 | 353 | 'url_query' => array( 0, 'QUERY' ), |
| 354 | + 'defaultsort_noerror' => array( 0, 'noerror' ), |
| 355 | + 'defaultsort_noreplace' => array( 0, 'noreplace' ), |
354 | 356 | ); |
355 | 357 | |
356 | 358 | /** |