Skip to content

Commit

Permalink
change file_exists to is_file check
Browse files Browse the repository at this point in the history
  • Loading branch information
noumo committed Aug 16, 2015
1 parent 9c73587 commit cfc6398
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion helpers/Image.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public static function upload(UploadedFile $fileInstance, $dir = '', $resizeWidt

static function thumb($filename, $width = null, $height = null, $crop = true)
{
if($filename && file_exists(($filename = Yii::getAlias('@webroot') . $filename)))
if($filename && is_file(($filename = Yii::getAlias('@webroot') . $filename)))
{
$info = pathinfo($filename);
$thumbName = $info['filename'] . '-' . md5( filemtime($filename) . (int)$width . (int)$height . (int)$crop ) . '.' . $info['extension'];
Expand Down

0 comments on commit cfc6398

Please sign in to comment.