Plugin Directory

Changeset 736172


Ignore:
Timestamp:
07/04/2013 02:08:23 PM (13 years ago)
Author:
zemanta
Message:

Thumbnailer bugfix

Location:
related-posts
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • related-posts/tags/2.8/thumbnailer.php

    r736135 r736172  
    239239    if (!$image_id || is_wp_error($image_id)) { return false; }
    240240
    241     if (is_array($imagedata = wp_get_attachment_metadata($image_id))) {
    242         return array(
    243             'id' => $image_id,
    244             'data' => $imagedata
    245         );
    246     }
    247 
    248     return false;
     241    $imagedata = wp_get_attachment_metadata($image_id);
     242    if (!$imagedata || !is_array($imagedata) || !isset($imagedata['sizes']) || !is_array($imagedata['sizes'])) {
     243        return false;
     244    }
     245
     246    return array(
     247        'id' => $image_id,
     248        'data' => $imagedata
     249    );
    249250}
    250251
  • related-posts/trunk/thumbnailer.php

    r736118 r736172  
    239239    if (!$image_id || is_wp_error($image_id)) { return false; }
    240240
    241     if (is_array($imagedata = wp_get_attachment_metadata($image_id))) {
    242         return array(
    243             'id' => $image_id,
    244             'data' => $imagedata
    245         );
    246     }
    247 
    248     return false;
     241    $imagedata = wp_get_attachment_metadata($image_id);
     242    if (!$imagedata || !is_array($imagedata) || !isset($imagedata['sizes']) || !is_array($imagedata['sizes'])) {
     243        return false;
     244    }
     245
     246    return array(
     247        'id' => $image_id,
     248        'data' => $imagedata
     249    );
    249250}
    250251
Note: See TracChangeset for help on using the changeset viewer.