Index: trunk/phase3/includes/Image.php |
— | — | @@ -1075,7 +1075,9 @@ |
1076 | 1076 | $urls = array(); |
1077 | 1077 | foreach ( $files as $file ) { |
1078 | 1078 | $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 ) { |
1080 | 1082 | $url = $this->thumbUrlFromName( $file ); |
1081 | 1083 | $urls[] = $url; |
1082 | 1084 | @unlink( "$dir/$file" ); |