* Prevent conversion of JavaScript code in language variants
* Output software version number in maintenance/parserTests.php
* (bug 7169) Use Ajax to watch/unwatch articles if enabled
+* Make variant table caching a little more robust, using main language code
+ in cache key. Probably this is still a bit wonky, though. Was breaking
+ parser tests when Chinese tables were getting loaded into Serbian code.
+
== Languages updated ==
$this->mMainLanguageCode = $maincode;
$this->mVariants = $variants;
$this->mVariantFallbacks = $variantfallbacks;
- $this->mCacheKey = wfMemcKey( 'conversiontables' );
+ $this->mCacheKey = wfMemcKey( 'conversiontables', $maincode );
$m = array('begin'=>'-{', 'flagsep'=>'|', 'codesep'=>':',
'varsep'=>';', 'end'=>'}-');
$this->mMarkup = array_merge($m, $markup);
$matches = preg_split($reg, $text, -1, PREG_SPLIT_OFFSET_CAPTURE);
$m = array_shift($matches);
+ if( !isset( $this->mTables[$toVariant] ) ) {
+ throw new MWException( "Broken variant table: " . implode( ',', array_keys( $this->mTables ) ) );
+ }
$ret = $this->mTables[$toVariant]->replace( $m[0] );
$mstart = $m[1]+strlen($m[0]);
foreach($matches as $m) {