summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--init.php12
1 files changed, 5 insertions, 7 deletions
diff --git a/init.php b/init.php
index 6a65cc5..1dd2eef 100644
--- a/init.php
+++ b/init.php
@@ -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);
}
}
}