diff --git a/classes/pluginhost.php b/classes/pluginhost.php index 1ad7afd60..457698291 100644 --- a/classes/pluginhost.php +++ b/classes/pluginhost.php @@ -43,6 +43,7 @@ class PluginHost { const HOOK_FORMAT_ENCLOSURES = 26; const HOOK_SUBSCRIBE_FEED = 27; const HOOK_HEADLINES_BEFORE = 28; + const HOOK_RENDER_ENCLOSURE = 29; const KIND_ALL = 1; const KIND_SYSTEM = 2; diff --git a/include/functions2.php b/include/functions2.php index a73f9a7a7..27b1933d0 100644 --- a/include/functions2.php +++ b/include/functions2.php @@ -1940,28 +1940,37 @@ foreach ($entries as $entry) { - if (preg_match("/image/", $entry["type"]) || - preg_match("/\.(jpg|png|gif|bmp)/i", $entry["filename"])) { + foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_RENDER_ENCLOSURE) as $plugin) + $retval = $plugin->hook_render_enclosure($entry, $hide_images); - if (!$hide_images) { - $encsize = ''; - if ($entry['height'] > 0) - $encsize .= ' height="' . intval($entry['width']) . '"'; - if ($entry['width'] > 0) - $encsize .= ' width="' . intval($entry['height']) . '"'; - $rv .= "
"; - } else { - $rv .= "" .htmlspecialchars($entry["url"]) . "
"; - } - if ($entry['title']) { - $rv.= "" .htmlspecialchars($entry["url"]) . "
"; + } + + if ($entry['title']) { + $rv.= "