I'm tagging this 1.18 because the original bug was for iswiktionary wanting it, so it'd be nice to get it in 1.18.
* Introduced $wgVaryOnXFPForAPI which will cause the API to send
Vary: X-Forwarded-Proto headers.
* New maintenance script to refresh image metadata (maintenance/refreshImageMetadata.php)
+* (bug 30722) Add a new collation that sorts categories in ascii sort order.
=== Bug fixes in 1.18 ===
* mw.util.getScript has been implemented (like wfScript in GlobalFunctions.php)
'HttpRequest' => 'includes/HttpFunctions.old.php',
'IContextSource' => 'includes/RequestContext.php',
'IcuCollation' => 'includes/Collation.php',
+ 'IdentityCollation' => 'includes/Collation.php',
'ImageGallery' => 'includes/ImageGallery.php',
'ImageHistoryList' => 'includes/ImagePage.php',
'ImageHistoryPseudoPager' => 'includes/ImagePage.php',
switch( $collationName ) {
case 'uppercase':
return new UppercaseCollation;
+ case 'identity':
+ return new IdentityCollation;
case 'uca-default':
return new IcuCollation( 'root' );
default:
}
}
+/**
+ * Collation class that's essentially a no-op.
+ *
+ * Does sorting based on binary value of the string.
+ * Like how things were pre 1.17.
+ */
+class IdentityCollation extends Collation {
+
+ function getSortKey( $string ) {
+ return $string;
+ }
+
+ function getFirstLetter( $string ) {
+ global $wgContLang;
+ // Copied from UppercaseCollation.
+ // I'm kind of unclear on when this could happen...
+ if ( $string[0] == "\0" ) {
+ $string = substr( $string, 1 );
+ }
+ return $wgContLang->firstChar( $string );
+ }
+}
+
+
class IcuCollation extends Collation {
var $primaryCollator, $mainCollator, $locale;
var $firstLetterData;
*
* - uppercase: Converts the category name to upper case, and sorts by that.
*
+ * - identity: Does no conversion. Sorts by binary value of the string.
+ *
* - uca-default: Provides access to the Unicode Collation Algorithm with
* the default element table. This is a compromise collation which sorts
* all languages in a mediocre way. However, it is better than "uppercase".
* the sort keys in the database.
*
* Extensions can define there own collations by subclassing Collation
- * and using the class name as the value of this variable.
+ * and using the Collation::factory hook.
*/
$wgCategoryCollation = 'uppercase';