Changeset 549 for branches/release-1_3


Ignore:
Timestamp:
Oct 3, 2004, 8:58:00 PM (20 years ago)
Author:
z0rglub
Message:

bug 43 : disable possibility to create thumbnail for pictures containing wrong characters

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/release-1_3/admin/thumbnail.php

    r319 r549  
    4848    while ( $file = readdir( $opendir ) )
    4949    {
    50       $path = $dir.'/'.$file;
    51       if ( is_image( $path, true ) )
     50      if (preg_match('/^[a-zA-Z0-9-_.]+$/', $file))
    5251      {
    53         if ( !TN_exists( $dir, $file ) )
     52        $path = $dir.'/'.$file;
     53        if ( is_image( $path, true ) )
    5454        {
    55           $image_infos = getimagesize( $path );
    56           $size = floor( filesize( $path ) / 1024 ). ' KB';
    57           array_push( $images, array( 'name' => $file,
    58                                       'width' => $image_infos[0],
    59                                       'height' => $image_infos[1],
    60                                       'size' => $size ) );
     55          if ( !TN_exists( $dir, $file ) )
     56          {
     57            $image_infos = getimagesize( $path );
     58            $size = floor( filesize( $path ) / 1024 ). ' KB';
     59            array_push( $images, array( 'name' => $file,
     60                                        'width' => $image_infos[0],
     61                                        'height' => $image_infos[1],
     62                                        'size' => $size ) );
     63          }
    6164        }
    6265      }
Note: See TracChangeset for help on using the changeset viewer.