# Clean up name according to title rules
$t = Title::newFromText( $name );
- $u->setName( $t->getText() );
- return $u;
+ if( is_null( $t ) ) {
+ return NULL;
+ } else {
+ $u->setName( $t->getText() );
+ return $u;
+ }
}
/**
foreach ( $defOpt as $oname => $val ) {
$this->mOptions[$oname] = $val;
}
+ /* so that new user will have a default
+ language variant set using info from the http header
+ */
+ $this->setOption('variant', $wgLang->getPreferredVariant());
}
/**
# 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' );
}
}
function getPageRenderingHash() {
+ global $wgLang;
if( $this->mHash ){
return $this->mHash;
}
$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 ;
}