aboutsummaryrefslogtreecommitdiffstats
path: root/admin
diff options
context:
space:
mode:
authorz0rglub <z0rglub@piwigo.org>2004-10-03 18:58:00 +0000
committerz0rglub <z0rglub@piwigo.org>2004-10-03 18:58:00 +0000
commit138fe984a2838a19571c0e8f1888a9c8c3ebe68b (patch)
treedd4349901c12942ff792d047bfb60a6f20668890 /admin
parentce4b79e7b0a359c4f751321eee9cf54464098313 (diff)
bug 43 : disable possibility to create thumbnail for pictures containing wrong characters
git-svn-id: http://piwigo.org/svn/branches/release-1_3@549 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'admin')
-rw-r--r--admin/thumbnail.php23
1 files changed, 13 insertions, 10 deletions
diff --git a/admin/thumbnail.php b/admin/thumbnail.php
index 75ecc60eb..d2269762f 100644
--- a/admin/thumbnail.php
+++ b/admin/thumbnail.php
@@ -47,17 +47,20 @@ function get_images_without_thumbnail( $dir )
{
while ( $file = readdir( $opendir ) )
{
- $path = $dir.'/'.$file;
- if ( is_image( $path, true ) )
+ if (preg_match('/^[a-zA-Z0-9-_.]+$/', $file))
{
- if ( !TN_exists( $dir, $file ) )
+ $path = $dir.'/'.$file;
+ if ( is_image( $path, true ) )
{
- $image_infos = getimagesize( $path );
- $size = floor( filesize( $path ) / 1024 ). ' KB';
- array_push( $images, array( 'name' => $file,
- 'width' => $image_infos[0],
- 'height' => $image_infos[1],
- 'size' => $size ) );
+ if ( !TN_exists( $dir, $file ) )
+ {
+ $image_infos = getimagesize( $path );
+ $size = floor( filesize( $path ) / 1024 ). ' KB';
+ array_push( $images, array( 'name' => $file,
+ 'width' => $image_infos[0],
+ 'height' => $image_infos[1],
+ 'size' => $size ) );
+ }
}
}
}
@@ -427,4 +430,4 @@ else
}
//----------------------------------------------------------- sending html code
$vtp->Parse( $handle , 'sub', $sub );
-?> \ No newline at end of file
+?>