From 46b17dc3b76187eb8579bd023998bc15eb98048e Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Tue, 3 Jan 2012 19:28:04 +0000 Subject: [PATCH] * Removed excess prepare() calls in initZones() - the batch functions already call prepare on the target dirs. * Tweaked call to secure() to align with what it actually does (it already makes the container private if possible). * A few documentation tweaks. --- includes/filerepo/FileRepo.php | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/includes/filerepo/FileRepo.php b/includes/filerepo/FileRepo.php index c3a91b5930..5b1339d0f5 100644 --- a/includes/filerepo/FileRepo.php +++ b/includes/filerepo/FileRepo.php @@ -115,10 +115,7 @@ class FileRepo { foreach ( (array)$doZones as $zone ) { $root = $this->getZonePath( $zone ); if ( $root === null ) { - throw new MWException( "No '$zone' zone defined in the $this->name repo." ); - } else { - $params = array( 'dir' => $this->getZonePath( $zone ) ); - $status->merge( $this->backend->prepare( $params ) ); + throw new MWException( "No '$zone' zone defined in the {$this->name} repo." ); } } return $status; @@ -128,14 +125,12 @@ class FileRepo { * Take all available measures to prevent web accessibility of new deleted * directories, in case the user has not configured offline storage * + * @param $dir string * @return void */ protected function initDeletedDir( $dir ) { - // Add a .htaccess file to the root of the deleted zone - $root = $this->getZonePath( 'deleted' ); - $this->backend->secure( array( 'dir' => $root, 'noAccess' => true ) ); - // Seed new directories with a blank index.html, to prevent crawling - $this->backend->secure( array( 'dir' => $dir, 'noListing' => true ) ); + $this->backend->secure( // prevent web access & dir listings + array( 'dir' => $dir, 'noAccess' => true, 'noListing' => true ) ); } /** @@ -1223,6 +1218,7 @@ class FileRepo { * May use either the database or the filesystem. * * @param $callback Array|string + * @return void */ public function enumFiles( $callback ) { $this->enumFilesInStorage( $callback ); @@ -1233,6 +1229,7 @@ class FileRepo { * May use either the database or the filesystem. * * @param $callback Array|string + * @return void */ protected function enumFilesInStorage( $callback ) { $publicRoot = $this->getZonePath( 'public' ); -- 2.20.1