Merge "Handle missing namespace prefix in XML dumps more gracefully"
[lhc/web/wiklou.git] / includes / collation / Collation.php
index 881c8c2..d67bc7e 100644 (file)
@@ -46,11 +46,13 @@ abstract class Collation {
         * @return Collation
         */
        public static function factory( $collationName ) {
+               global $wgContLang;
+
                switch ( $collationName ) {
                        case 'uppercase':
                                return new UppercaseCollation;
                        case 'numeric':
-                               return new NumericUppercaseCollation;
+                               return new NumericUppercaseCollation( $wgContLang );
                        case 'identity':
                                return new IdentityCollation;
                        case 'uca-default':
@@ -61,9 +63,11 @@ abstract class Collation {
                                return new CollationCkb;
                        case 'xx-uca-et':
                                return new CollationEt;
+                       case 'xx-uca-fa':
+                               return new CollationFa;
                        default:
                                $match = [];
-                               if ( preg_match( '/^uca-([a-z@=-]+)$/', $collationName, $match ) ) {
+                               if ( preg_match( '/^uca-([A-Za-z@=-]+)$/', $collationName, $match ) ) {
                                        return new IcuCollation( $match[1] );
                                }