]> git.wh0rd.org - tt-rss.git/blobdiff - include/functions.php
add plugin to cache images in starred articles; pass article_id to
[tt-rss.git] / include / functions.php
index 48111e4095a3f97738c9431c51e70b7a2b59e491..56361472ee5f4cc9b280fc6a5fce02932c89d7bf 100644 (file)
 
        }
 
-       function sanitize($str, $force_remove_images = false, $owner = false, $site_url = false, $highlight_words = false) {
+       function sanitize($str, $force_remove_images = false, $owner = false, $site_url = false, $highlight_words = false, $article_id = false) {
                if (!$owner) $owner = $_SESSION["uid"];
 
                $res = trim($str); if (!$res) return '';
                $disallowed_attributes = array('id', 'style', 'class');
 
                foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_SANITIZE) as $plugin) {
-                       $retval = $plugin->hook_sanitize($doc, $site_url, $allowed_elements, $disallowed_attributes);
+                       $retval = $plugin->hook_sanitize($doc, $site_url, $allowed_elements, $disallowed_attributes, $article_id);
                        if (is_array($retval)) {
                                $doc = $retval[0];
                                $allowed_elements = $retval[1];
 
                        $line["content"] = sanitize($line["content"],
                                sql_bool_to_bool($line['hide_images']),
-                               $owner_uid, $line["site_url"]);
+                               $owner_uid, $line["site_url"], false, $line["id"]);
 
                        foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_RENDER_ARTICLE) as $p) {
                                $line = $p->hook_render_article($line);