From 9db190c7e736ec8d063187d4241b59feaf7dc2d1 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Wed, 22 Jun 2011 11:28:20 +0200 Subject: update to MediaWiki 1.17.0 --- includes/filerepo/RepoGroup.php | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) (limited to 'includes/filerepo/RepoGroup.php') diff --git a/includes/filerepo/RepoGroup.php b/includes/filerepo/RepoGroup.php index 1465400c..b9996941 100644 --- a/includes/filerepo/RepoGroup.php +++ b/includes/filerepo/RepoGroup.php @@ -1,14 +1,19 @@ getNamespace() != NS_MEDIA && $title->getNamespace() != NS_FILE ) { + throw new MWException( __METHOD__ . ' recieved an Title object with incorrect namespace' ); + } + # Check the cache if ( empty( $options['ignoreRedirect'] ) && empty( $options['private'] ) - && empty( $options['bypassCache'] ) ) + && empty( $options['bypassCache'] ) + && $title->getNamespace() == NS_FILE ) { $useCache = true; $time = isset( $options['time'] ) ? $options['time'] : ''; @@ -224,7 +237,7 @@ class RepoGroup { if ( !$this->reposInitialised ) { $this->initialiseRepos(); } - foreach ( $this->foreignRepos as $key => $repo ) { + foreach ( $this->foreignRepos as $repo ) { if ( $repo->name == $name) return $repo; } @@ -243,8 +256,8 @@ class RepoGroup { * Call a function for each foreign repo, with the repo object as the * first parameter. * - * @param $callback callback The function to call - * @param $params array Optional additional parameters to pass to the function + * @param $callback Callback: the function to call + * @param $params Array: optional additional parameters to pass to the function */ function forEachForeignRepo( $callback, $params = array() ) { foreach( $this->foreignRepos as $repo ) { @@ -258,7 +271,7 @@ class RepoGroup { /** * Does the installation have any foreign repos set up? - * @return bool + * @return Boolean */ function hasForeignRepos() { return (bool)$this->foreignRepos; -- cgit v1.2.3-54-g00ecf