Added $wgAllUnicodeFixes to replace live-hack at twn
authorNiklas Laxström <nikerabbit@users.mediawiki.org>
Thu, 8 Jul 2010 09:15:53 +0000 (09:15 +0000)
committerNiklas Laxström <nikerabbit@users.mediawiki.org>
Thu, 8 Jul 2010 09:15:53 +0000 (09:15 +0000)
includes/DefaultSettings.php
languages/Language.php

index db0a955..d193611 100644 (file)
@@ -1776,6 +1776,18 @@ $wgFixArabicUnicode = true;
  */
 $wgFixMalayalamUnicode = true;
 
+/**
+ * Set this to always convert certain Unicode sequences to modern ones
+ * regardless of the content language. This has a small performance
+ * impact.
+ *
+ * See $wgFixArabicUnicode and $wgFixMalayalamUnicode for conversion
+ * details.
+ *
+ * @since 1.17
+ */
+$wgAllUnicodeFixes = false;
+
 /**
  * Set this to eg 'ISO-8859-1' to perform character set conversion when 
  * loading old revisions not marked with "utf-8" flag. Use this when 
index cc2a95f..41619f7 100644 (file)
@@ -1934,7 +1934,14 @@ class Language {
         * This is language-specific for performance reasons only.
         */
        function normalize( $s ) {
-               return UtfNormal::cleanUp( $s );
+               global $wgAllUnicodeFixes;
+               $s = UtfNormal::cleanUp( $s );
+               if ( $wgAllUnicodeFixes ) {
+                       $s = $this->transformUsingPairFile( 'normalize-ar.ser', $s );
+                       $s = $this->transformUsingPairFile( 'normalize-ml.ser', $s );
+               }
+
+               return $s;
        }
 
        /**