* @return Article object
*/
static function articleFromTitle( &$title ) {
- $article = null;
- wfRunHooks( 'ArticleFromTitle', array( &$title, &$article ) );
- if ( $article ) {
- return $article;
- }
-
if( NS_MEDIA == $title->getNamespace() ) {
// FIXME: where should this go?
$title = Title::makeTitle( NS_IMAGE, $title->getDBkey() );
}
+ $article = null;
+ wfRunHooks( 'ArticleFromTitle', array( &$title, &$article ) );
+ if( $article ) {
+ return $article;
+ }
+
switch( $title->getNamespace() ) {
case NS_IMAGE:
$file = wfFindFile( $title );