Changeset 12756


Ignore:
Timestamp:
Dec 17, 2011, 6:45:49 PM (9 years ago)
Author:
patdenice
Message:

bug:2537
Thumbnail creation may crash on some servers

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/include/image.class.php

    r12749 r12756  
    422422
    423423    $command = $imagickdir.'identify -format "%wx%h" "'.realpath($source_filepath).'"';
    424     @exec($command, $returnarray, $returnvalue);
    425     if($returnvalue or !preg_match('/^(\d+)x(\d+)$/', $returnarray[0], $match))
     424    @exec($command, $returnarray);
     425    if(!is_array($returnarray) or empty($returnarray[0]) or !preg_match('/^(\d+)x(\d+)$/', $returnarray[0], $match))
    426426    {
    427427      die("[External ImageMagick] Corrupt image");
     
    496496    $dest = pathinfo($destination_filepath);
    497497    $exec .= ' "'.realpath($dest['dirname']).'/'.$dest['basename'].'"';
    498     @exec($exec, $returnarray, $returnvalue);
    499     return !$returnvalue;
     498    @exec($exec, $returnarray);
     499    return is_array($returnarray);
    500500  }
    501501}
Note: See TracChangeset for help on using the changeset viewer.