r21714 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r21713‎ | r21714 | r21715 >
Date:10:28, 30 April 2007
Author:tstarling
Status:old
Tags:
Comment:
More general thumbnail filename check on purge, to allow for general parameter strings
Modified paths:
  • /trunk/phase3/includes/Image.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Image.php
@@ -1075,7 +1075,9 @@
10761076 $urls = array();
10771077 foreach ( $files as $file ) {
10781078 $m = array();
1079 - if ( preg_match( '/^\d+px/', $file, $m ) ) {
 1079+ # Check that the base image name is part of the thumb name
 1080+ # This is a basic sanity check to avoid erasing unrelated directories
 1081+ if ( strpos( $file, $this->name ) !== false ) {
10801082 $url = $this->thumbUrlFromName( $file );
10811083 $urls[] = $url;
10821084 @unlink( "$dir/$file" );