Catch temp container thumbnails in cleanup script
authorAaron Schulz <aschulz@wikimedia.org>
Wed, 6 Nov 2013 20:47:49 +0000 (12:47 -0800)
committerAaron Schulz <aschulz@wikimedia.org>
Wed, 6 Nov 2013 20:47:49 +0000 (12:47 -0800)
Change-Id: Iba2badac3abf08e5c4a409ccf10d831e0e9b341e

maintenance/cleanupUploadStash.php

index ba7c3cf..bc43c67 100644 (file)
@@ -120,7 +120,9 @@ class UploadStashCleanup extends Maintenance {
                $i = 0;
                foreach ( $iterator as $file ) {
                        // Absolute sanity check for stashed files and file segments
-                       if ( !preg_match( '#(^\d{14}!|\.\d+\.\w+\.\d+$)#', basename( $file ) ) ) {
+                       $base = basename( $file );
+                       // @TODO: why are there thumbnails stored in here?
+                       if ( !preg_match( '#(^\d{14}!|\.\d+\.\w+\.\d+$|-\w{12}\.\w{6}\.\d+\.)#', $base ) ) {
                                $this->output( "Skipped non-stash $file\n" );
                                continue;
                        }