From: Ian Baker Date: Thu, 4 Aug 2011 21:19:08 +0000 (+0000) Subject: Fixed bug where global wgUploadStashMaxAge wasn't used, removed redundant defaults... X-Git-Tag: 1.31.0-rc.0~28433 X-Git-Url: http://git.cyclocoop.org/%22%2C%20generer_url_ecrire%28?a=commitdiff_plain;h=54a8faa0cf4a74540ee765369cbd58b0d38e85f6;p=lhc%2Fweb%2Fwiklou.git Fixed bug where global wgUploadStashMaxAge wasn't used, removed redundant defaults. Followup to r93476 --- diff --git a/includes/upload/UploadStash.php b/includes/upload/UploadStash.php index 166f9056c3..b46a6fb9c3 100644 --- a/includes/upload/UploadStash.php +++ b/includes/upload/UploadStash.php @@ -69,12 +69,6 @@ class UploadStash { $this->userId = $this->user->getId(); $this->isLoggedIn = $this->user->isLoggedIn(); } - - // Age of the repository in seconds. That is, after how long will files be assumed abandoned and deleted? - global $wgUploadStashMaxAge; - if( $wgUploadStashMaxAge === null ) { - $wgUploadStashMaxAge = 6 * 3600; // default: 6 hours. - } } /** @@ -272,6 +266,7 @@ class UploadStash { // - the key is owned by someone else and // - the age of the key is less than $wgUploadStashMaxAge if ( is_object( $row ) ) { + global $wgUploadStashMaxAge; if ( $row->us_user != $this->userId && $row->wfTimestamp( TS_UNIX, $row->us_timestamp ) > time() - $wgUploadStashMaxAge ) { diff --git a/maintenance/cleanupUploadStash.php b/maintenance/cleanupUploadStash.php index 4e85472f53..46bf234184 100644 --- a/maintenance/cleanupUploadStash.php +++ b/maintenance/cleanupUploadStash.php @@ -41,9 +41,6 @@ class UploadStashCleanup extends Maintenance { // how far back should this look for files to delete? global $wgUploadStashMaxAge; - if( $wgUploadStashMaxAge === null ) { - $wgUploadStashMaxAge = 6 * 3600; // default: 6 hours. - } $this->output( "Getting list of files to clean up...\n" ); $res = $dbr->select(