r32225 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r32224‎ | r32225 | r32226 >
Date:16:39, 20 March 2008
Author:vasilievvv
Status:old
Tags:
Comment:
Use Title::makeTitleSafe
Modified paths:
  • /trunk/phase3/includes/Category.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Category.php
@@ -206,6 +206,7 @@
207207 public function getSubcatCount() { return $this->getX( 'mSubcats' ); }
208208 /** @return mixed Number of member files, or false on failure */
209209 public function getFileCount() { return $this->getX( 'mFiles' ); }
 210+
210211 /**
211212 * This is not implemented in the base class, because arrays of Titles are
212213 * evil.
@@ -216,8 +217,7 @@
217218 if( !$this->initialize() ) {
218219 return false;
219220 }
220 - # FIXME is there a better way to do this?
221 - return Title::newFromText( "Category:{$this->mNames[0]}" );
 221+ return Title::makeTitleSafe( NS_CATEGORY, $this->mNames[0] );
222222 }
223223
224224 /** Generic accessor */

Status & tagging log