Fixed bug where global wgUploadStashMaxAge wasn't used, removed redundant defaults...
authorIan Baker <raindrift@users.mediawiki.org>
Thu, 4 Aug 2011 21:19:08 +0000 (21:19 +0000)
committerIan Baker <raindrift@users.mediawiki.org>
Thu, 4 Aug 2011 21:19:08 +0000 (21:19 +0000)
includes/upload/UploadStash.php
maintenance/cleanupUploadStash.php

index 166f905..b46a6fb 100644 (file)
@@ -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
                        ) {
index 4e85472..46bf234 100644 (file)
@@ -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(