[FileRepo] Fixed purging for "short style" thumbnail names.
authorAaron Schulz <aschulz@wikimedia.org>
Mon, 29 Oct 2012 18:09:43 +0000 (11:09 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Mon, 29 Oct 2012 18:09:43 +0000 (11:09 -0700)
Change-Id: If63b4c609b7bc43cda658cb87abe59562b335c69

includes/filerepo/file/LocalFile.php

index f42df55..f0a3c15 100644 (file)
@@ -814,7 +814,9 @@ class LocalFile extends File {
                foreach ( $files as $file ) {
                        # Check that the base file name is part of the thumb name
                        # This is a basic sanity check to avoid erasing unrelated directories
-                       if ( strpos( $file, $this->getName() ) !== false ) {
+                       if ( strpos( $file, $this->getName() ) !== false
+                               || strpos( $file, "-thumbnail" ) !== false // "short" thumb name
+                       ) {
                                $purgeList[] = "{$dir}/{$file}";
                        }
                }