From: Tim Starling Date: Mon, 30 Apr 2007 10:28:21 +0000 (+0000) Subject: More general thumbnail filename check on purge, to allow for general parameter strings X-Git-Tag: 1.31.0-rc.0~53172 X-Git-Url: http://git.cyclocoop.org/%24action?a=commitdiff_plain;h=bb63c1c6041659dc076c82e764fe9097653897e1;p=lhc%2Fweb%2Fwiklou.git More general thumbnail filename check on purge, to allow for general parameter strings --- diff --git a/includes/Image.php b/includes/Image.php index 0c40c92eb8..8cc8c39597 100644 --- a/includes/Image.php +++ b/includes/Image.php @@ -1075,7 +1075,9 @@ class Image $urls = array(); foreach ( $files as $file ) { $m = array(); - if ( preg_match( '/^\d+px/', $file, $m ) ) { + # Check that the base image name is part of the thumb name + # This is a basic sanity check to avoid erasing unrelated directories + if ( strpos( $file, $this->name ) !== false ) { $url = $this->thumbUrlFromName( $file ); $urls[] = $url; @unlink( "$dir/$file" );