Skip to content

Commit

Permalink
Fix for S3
Browse files Browse the repository at this point in the history
  • Loading branch information
jawngee committed Sep 8, 2017
1 parent b51c555 commit 646e4ae
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions classes/tools/s3/ilab-media-s3-tool.php
Original file line number Diff line number Diff line change
Expand Up @@ -1012,15 +1012,24 @@ public function imageDownsize($fail,$id,$size)
return $fail;
}

if (empty($size) || empty($id)) {
if (empty($size) || empty($id) || is_array($size)) {
return $fail;
}

$meta=wp_get_attachment_metadata($id);
if (empty($meta) || !isset($meta['sizes']) || !isset($meta['sizes'][$size])) {

if (empty($meta)) {
return $fail;
}

if (!isset($meta['sizes'])) {
return $fail;
}

if (!isset($meta['sizes'][$size])) {
return $fail;
}

$sizeMeta = $meta['sizes'][$size];
if (!isset($sizeMeta['s3'])) {
return $fail;
Expand Down

0 comments on commit 646e4ae

Please sign in to comment.