diff options
author | Andrew Dolgov <[email protected]> | 2024-01-28 14:47:51 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2024-01-28 14:47:51 +0300 |
commit | c5f36fa6c561532707531cace3ea140618d5fc22 (patch) | |
tree | 7f9cd5742584f7415a4d50b4677599e90c83a7ba | |
parent | 1074b0a203f8192dd74b15f67e0a168cf9f3187a (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.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); } } } |