diff options
author | Richard Beales <[email protected]> | 2013-03-19 19:20:14 +0000 |
---|---|---|
committer | Richard Beales <[email protected]> | 2013-03-19 19:20:14 +0000 |
commit | 598a8f37a2ce94186166d1c3b22cc65efdebe4a4 (patch) | |
tree | 0243d171f3f0b3bc61861f780089d82d93933557 /include | |
parent | 05809dfdf7cbf7699be6408c0f49d325585726b5 (diff) | |
parent | 451ff72289aa705c8f1d57af604881a66a77e95d (diff) |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'include')
-rw-r--r-- | include/functions.php | 27 | ||||
-rw-r--r-- | include/localized_schema.php | 4 |
2 files changed, 23 insertions, 8 deletions
diff --git a/include/functions.php b/include/functions.php index affd4d4dc..1feedcbf0 100644 --- a/include/functions.php +++ b/include/functions.php @@ -1,6 +1,6 @@ <?php define('EXPECTED_CONFIG_VERSION', 26); - define('SCHEMA_VERSION', 105); + define('SCHEMA_VERSION', 106); $fetch_last_error = false; $pluginhost = false; @@ -2461,6 +2461,7 @@ num_comments, comments, int_id, + hide_images, unread,feed_id,marked,published,link,last_read,orig_feed_id, last_marked, last_published, ".SUBSTRING_FOR_DATE."(last_read,1,19) as last_read_noms, @@ -2505,6 +2506,7 @@ "label_cache," . "link," . "last_read," . + "hide_images," . "last_marked, last_published, " . SUBSTRING_FOR_DATE . "(last_read,1,19) as last_read_noms," . $since_id_part . @@ -2560,15 +2562,11 @@ } - function sanitize($link, $str, $force_strip_tags = false, $owner = false, $site_url = false) { + function sanitize($link, $str, $force_remove_images = false, $owner = false, $site_url = false) { if (!$owner) $owner = $_SESSION["uid"]; $res = trim($str); if (!$res) return ''; - if (get_pref($link, "STRIP_IMAGES", $owner)) { - $res = preg_replace('/<img[^>]+>/is', '', $res); - } - if (strpos($res, "href=") === false) $res = rewrite_urls($res); @@ -2605,6 +2603,23 @@ $entry->setAttribute('src', $src); } + + if ($entry->nodeName == 'img') { + if (get_pref($link, "STRIP_IMAGES", $owner) || $force_remove_images) { + + $p = $doc->createElement('p'); + + $a = $doc->createElement('a'); + $a->setAttribute('href', $entry->getAttribute('src')); + + $a->appendChild(new DOMText($entry->getAttribute('src'))); + $a->setAttribute('target', '_blank'); + + $p->appendChild($a); + + $entry->parentNode->replaceChild($p, $entry); + } + } } if (strtolower($entry->nodeName) == "a") { diff --git a/include/localized_schema.php b/include/localized_schema.php index f5acae99c..cf09930d3 100644 --- a/include/localized_schema.php +++ b/include/localized_schema.php @@ -1,4 +1,4 @@ -<?php # This file has been generated at: Tue Mar 19 10:14:58 MSK 2013 +<?php # This file has been generated at: Tue Mar 19 22:42:44 MSK 2013 __("Title"); __("Title or Content"); @@ -54,7 +54,7 @@ __('Automatically expand articles in combined mode'); __('Purge unread articles'); __('Show special feeds when hiding read feeds'); __('Group headlines in virtual feeds'); -__('Hide images in articles'); +__('Do not embed images in articles'); __('Enable external API'); __('User timezone'); __('Customize stylesheet'); |