# 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;
+ }
}
/**
*/
function whoIs( $id ) {
$dbr =& wfGetDB( DB_SLAVE );
- return $dbr->getField( 'user', 'user_name', array( 'user_id' => $id ) );
+ return $dbr->selectField( 'user', 'user_name', array( 'user_id' => $id ) );
}
/**
*/
function whoIsReal( $id ) {
$dbr =& wfGetDB( DB_SLAVE );
- return $dbr->getField( 'user', 'user_real_name', array( 'user_id' => $id ) );
+ return $dbr->selectField( 'user', 'user_real_name', array( 'user_id' => $id ) );
}
/**
return null;
}
$dbr =& wfGetDB( DB_SLAVE );
- $s = $dbr->getArray( 'user', array( 'user_id' ), array( 'user_name' => $nt->getText() ), $fname );
+ $s = $dbr->selectRow( 'user', array( 'user_id' ), array( 'user_name' => $nt->getText() ), $fname );
if ( $s === false ) {
return 0;
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());
}
/**
return;
} # the following stuff is for non-anonymous users only
- $s = $dbr->getArray( 'user', array( 'user_name','user_password','user_newpassword','user_email',
+ $s = $dbr->selectRow( 'user', array( 'user_name','user_password','user_newpassword','user_email',
'user_real_name','user_options','user_touched' ),
array( 'user_id' => $this->mId ), $fname );
$this->decodeOptions( $s->user_options );
$this->mTouched = wfTimestamp(TS_MW,$s->user_touched);
$this->mRights = explode( ",", strtolower(
- $dbr->getField( 'user_rights', 'user_rights', array( 'user_id' => $this->mId ) )
+ $dbr->selectField( 'user_rights', 'user_rights', array( 'user_id' => $this->mId ) )
) );
}
# 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 ;
}