From: Aaron Schulz Date: Tue, 22 Apr 2008 01:06:51 +0000 (+0000) Subject: Don't make extensions have to play around with NS_MEDIA X-Git-Tag: 1.31.0-rc.0~48141 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_aide%28?a=commitdiff_plain;h=5d2ee948f24855218a62a6300340e8cfefe0a5a0;p=lhc%2Fweb%2Fwiklou.git Don't make extensions have to play around with NS_MEDIA --- diff --git a/includes/Wiki.php b/includes/Wiki.php index 2269d27545..8930902ff8 100644 --- a/includes/Wiki.php +++ b/includes/Wiki.php @@ -239,17 +239,17 @@ class MediaWiki { * @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 );