Skip to content

Commit

Permalink
Merge pull request #1690 from akairain/patch-1
Browse files Browse the repository at this point in the history
Windows 서버에서 이미지 사이즈 구하기 오류 수정
  • Loading branch information
inureyes committed Aug 6, 2014
2 parents fe4846a + 7fe2403 commit 74246f3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions library/model/blog.attachment.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,10 @@ function addAttachment($blogid, $parent, $file) {
$attachment['name'] = rand(1000000000, 9999999999) . ".$extension";
$attachment['path'] = "$path/{$attachment['name']}";
} while (file_exists($attachment['path']));
if ($imageAttributes = @getimagesize($file['tmp_name'])) {
if (!move_uploaded_file($file['tmp_name'], $attachment['path']))
return false;
@chmod($attachment['path'], 0666);
if ($imageAttributes = @getimagesize($attachment['path'])) {
$attachment['mime'] = $imageAttributes['mime'];
$attachment['width'] = $imageAttributes[0];
$attachment['height'] = $imageAttributes[1];
Expand All @@ -156,9 +159,6 @@ function addAttachment($blogid, $parent, $file) {
$attachment['width'] = 0;
$attachment['height'] = 0;
}
if (!move_uploaded_file($file['tmp_name'], $attachment['path']))
return false;
@chmod($attachment['path'], 0666);
$attachment['label'] = UTF8::lessenAsEncoding($attachment['label'], 64);
$attachment['mime'] = UTF8::lessenAsEncoding($attachment['mime'], 32);

Expand Down

0 comments on commit 74246f3

Please sign in to comment.