fix for several problems found by Eloquence:
[lhc/web/wiklou.git] / includes / User.php
index 12d62ca..a38f60c 100644 (file)
@@ -167,7 +167,7 @@ class User {
         /* so that new user will have a default 
            language variant set using info from the http header 
         */
-        $this->setOption('variant', $wgLang->getPreferredLanguage());
+        $this->setOption('variant', $wgLang->getPreferredVariant());
        }
 
        /**
@@ -583,8 +583,9 @@ class User {
                        # Check if we got if not failback to default skin
                        $sn = 'Skin'.$sn;
                        if(!class_exists($sn)) {
-                               #FIXME : should we print an error message instead of loading
-                               # standard skin ?
+                               # FIXME : should we print an error message instead of loading
+                               # standard skin ? Let's die for now. [AV]
+                               die("Class $sn doesn't exist in $IP/skins/$sn.php");
                                $sn = 'SkinStandard';
                                require_once( $IP.'/skins/Standard.php' );
                        }
@@ -813,6 +814,7 @@ class User {
        }
 
        function getPageRenderingHash() {
+        global $wgLang;
                if( $this->mHash ){
                        return $this->mHash;
                }
@@ -829,6 +831,12 @@ class User {
                $confstr .= '!' . $this->getOption( 'date' );
                $confstr .= '!' . $this->getOption( 'numberheadings' );
 
+        // add in language variant option if there are multiple variants
+        // supported by the language object
+        if(sizeof($wgLang->getVariants())>1) {
+             $confstr .= '!' . $this->getOption( 'variant' );
+        }
+
                $this->mHash = $confstr;
                return $confstr ;
        }