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
This commit is contained in:
z0rglub
2004-10-03 18:58:00 +00:00
parent ce4b79e7b0
commit 138fe984a2
+13 -10
View File
@@ -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 );
?>
?>