diff options
Diffstat (limited to 'init.php')
-rw-r--r-- | init.php | 12 |
1 files changed, 5 insertions, 7 deletions
@@ -487,13 +487,11 @@ class Api_Resize_Media extends Plugin { $widths, true); } - if (isset($article["enclosures"]) && is_array($article["enclosures"])) { - for ($i = 0; $i < count($article["enclosures"]); $i++) { - if (preg_match("/image/", $article["enclosures"][$i][1])) { - $this->prepare_thumbnails( - UrlHelper::rewrite_relative($site_url, $article["enclosures"][$i][0]), - $widths, false); - } + foreach ($article["enclosures"] as $enc) { + if (preg_match("/image/", $enc->type)) { + $this->prepare_thumbnails( + UrlHelper::rewrite_relative($site_url, $enc->link), + $widths, false); } } } |