mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-08-12 11:43:01 +02:00
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:
+13
-10
@@ -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 );
|
||||
?>
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user