summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2024-01-28 14:47:51 +0300
committerAndrew Dolgov <[email protected]>2024-01-28 14:47:51 +0300
commitc5f36fa6c561532707531cace3ea140618d5fc22 (patch)
tree7f9cd5742584f7415a4d50b4677599e90c83a7ba
parent1074b0a203f8192dd74b15f67e0a168cf9f3187a (diff)
switch to FeedEnclosure being passed instead of array in HOOK_ARTICLE_FILTER, remove check for enclosures being an array because it should be always defined of this type
-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);
}
}
}