From: Andrew Dolgov Date: Tue, 19 Mar 2013 18:41:10 +0000 (+0400) Subject: rework STRIP_IMAGES to remove embedding; add per-feed control over embedded images... X-Git-Tag: 1.7.5~93 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=bfd61d3f85d9b2554a016e4c2f711a1285ff8818;p=tt-rss.git rework STRIP_IMAGES to remove embedding; add per-feed control over embedded images (bump schema) --- diff --git a/classes/api.php b/classes/api.php index 74464821..92e19e70 100644 --- a/classes/api.php +++ b/classes/api.php @@ -636,7 +636,9 @@ class API extends Handler { if ($sanitize_content) { $headline_row["content"] = sanitize($link, - $line["content_preview"], false, false, $line["site_url"]); + $line["content_preview"], + sql_bool_to_bool($line['hide_images']), + false, $line["site_url"]); } else { $headline_row["content"] = $line["content_preview"]; } diff --git a/classes/feeds.php b/classes/feeds.php index d598a9e4..297cad30 100644 --- a/classes/feeds.php +++ b/classes/feeds.php @@ -481,7 +481,7 @@ class Feeds extends Handler_Protected { unset($line["tag_cache"]); $line["content"] = sanitize($this->link, $line["content_preview"], - false, false, $entry_site_url); + sql_bool_to_bool($line['hide_images']), false, $entry_site_url); foreach ($pluginhost->get_hooks($pluginhost::HOOK_RENDER_ARTICLE_CDM) as $p) { $line = $p->hook_render_article_cdm($line); diff --git a/classes/pref/feeds.php b/classes/pref/feeds.php index bfcc75f0..285995df 100644 --- a/classes/pref/feeds.php +++ b/classes/pref/feeds.php @@ -613,6 +613,18 @@ class Pref_Feeds extends Handler_Protected { name=\"always_display_enclosures\" $checked> "; + $hide_images = sql_bool_to_bool(db_fetch_result($result, 0, "hide_images")); + + if ($hide_images) { + $checked = "checked=\"1\""; + } else { + $checked = ""; + } + + print "
 "; $cache_images = sql_bool_to_bool(db_fetch_result($result, 0, "cache_images")); @@ -804,6 +816,14 @@ class Pref_Feeds extends Handler_Protected { print " "; $this->batch_edit_cbox("always_display_enclosures", "always_display_enclosures_l"); + print "
 "; + + print " "; $this->batch_edit_cbox("hide_images", "hide_images_l"); + print "