Merge "Initialise variables and update documentation"
[lhc/web/wiklou.git] / languages / LanguageConverter.php
index 79ddb6a..d4c38af 100644 (file)
@@ -70,7 +70,7 @@ class LanguageConverter {
        public $mMaxDepth = 10;
        public $mVarSeparatorPattern;
 
-       const CACHE_VERSION_KEY = 'VERSION 6';
+       const CACHE_VERSION_KEY = 'VERSION 7';
 
        /**
         * Constructor
@@ -1103,6 +1103,7 @@ class LanguageConverter {
         * @param $text String: text to armour against conversion
         * @return String: armoured text where { and } have been converted to
         *                 { and }
+        * @deprecated since 1.22 is no longer used
         */
        public function armourMath( $text ) {
                // convert '-{' and '}-' to '-{' and '}-' to prevent
@@ -1263,7 +1264,10 @@ class ConverterRule {
                $variants = $this->mConverter->mVariants;
                $varsep_pattern = $this->mConverter->getVarSeparatorPattern();
 
+               // Split according to $varsep_pattern, but ignore semicolons from HTML entities
+               $rules = preg_replace( '/(&[#a-zA-Z0-9]+);/', "$1\x01", $rules );
                $choice = preg_split( $varsep_pattern, $rules );
+               $choice = str_replace( "\x01", ';', $choice );
 
                foreach ( $choice as $c ) {
                        $v = explode( ':', $c, 2 );