Fix case of some Title methods
[lhc/web/wiklou.git] / languages / classes / LanguageSr.php
index 3610c1e..b29cfb8 100644 (file)
@@ -139,7 +139,7 @@ class SrConverter extends LanguageConverter {
         */
        function autoConvert( $text, $toVariant = false ) {
                global $wgTitle;
-               if ( is_object( $wgTitle ) && $wgTitle->getNameSpace() == NS_FILE ) {
+               if ( is_object( $wgTitle ) && $wgTitle->getNamespace() == NS_FILE ) {
                        $imagename = $wgTitle->getNsText();
                        if ( preg_match( "/^$imagename:/", $text ) ) return $text;
                }
@@ -167,6 +167,7 @@ class SrConverter extends LanguageConverter {
                $matches = preg_split( $reg, $text, -1, PREG_SPLIT_OFFSET_CAPTURE );
 
                $m = array_shift( $matches );
+               $this->loadTables();
                if ( !isset( $this->mTables[$toVariant] ) ) {
                        throw new MWException( "Broken variant table: " . implode( ',', array_keys( $this->mTables ) ) );
                }