From: Brion Vibber Date: Sun, 21 Nov 2004 09:47:00 +0000 (+0000) Subject: Try to keep Title class as a value object: remove the setNamespace() method. Make... X-Git-Tag: 1.5.0alpha1~1287 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/operations/recherche.php?a=commitdiff_plain;h=0d3a3e02112928b72f83d6ef83c6d006320c2861;p=lhc%2Fweb%2Fwiklou.git Try to keep Title class as a value object: remove the setNamespace() method. Make a new object if you want to change it... --- diff --git a/includes/SpecialContributions.php b/includes/SpecialContributions.php index aa1da78215..875bd25d7c 100644 --- a/includes/SpecialContributions.php +++ b/includes/SpecialContributions.php @@ -40,7 +40,7 @@ function wfSpecialContributions( $par = '' ) { $wgOut->errorpage( 'notargettitle', 'notargettext' ); return; } - $nt->setNamespace( Namespace::getUser() ); + $nt =& Title::makeTitle( NS_USER, $nt->getDBkey() ); $id = User::idFromName( $nt->getText() ); diff --git a/includes/SpecialUpload.php b/includes/SpecialUpload.php index f4fd321473..1e3d40c76d 100644 --- a/includes/SpecialUpload.php +++ b/includes/SpecialUpload.php @@ -178,7 +178,7 @@ class UploadForm { if( is_null( $nt ) ) { return $this->uploadError( wfMsg( 'illegalfilename', htmlspecialchars( $filtered ) ) ); } - $nt->setNamespace( NS_IMAGE ); + $nt =& Title::makeTitle( NS_IMAGE, $nt->getDBkey() ); $this->mUploadSaveName = $nt->getDBkey(); /** diff --git a/includes/Title.php b/includes/Title.php index b23dd4b2e7..b017959130 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -466,12 +466,6 @@ class Title { * @access public */ function getNamespace() { return $this->mNamespace; } - /** - * Set the namespace index - * @param int $n the namespace index, one of the NS_xxxx constants - * @access public - */ - function setNamespace( $n ) { $this->mNamespace = IntVal( $n ); } /** * Get the interwiki prefix (or null string) * @return string