From 8493163576feed8a978a6525d6d4567d2ed2cc4c Mon Sep 17 00:00:00 2001 From: JustAMacUser Date: Thu, 13 Aug 2015 20:46:45 -0400 Subject: Unset $retval after HOOK_FORMAT_ENCLOSURES. Fixes an edge case where changing the array of enclosures with HOOK_FORMAT_ENCLOSURES might break the dropdown rendering if HOOK_RENDER_ENCLOSURE has no registered hooks. --- include/functions2.php | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/functions2.php b/include/functions2.php index b4018453e..445e9e022 100644 --- a/include/functions2.php +++ b/include/functions2.php @@ -1890,6 +1890,7 @@ $rv = $retval; } } + unset($retval); // Unset to prevent breaking render if there are no HOOK_RENDER_ENCLOSURE hooks below. if ($rv === '' && !empty($result)) { $entries_html = array(); -- cgit v1.2.3 From 4a27966e78407d4482de5d1a70093930f9eb8b85 Mon Sep 17 00:00:00 2001 From: JustAMacUser Date: Fri, 14 Aug 2015 19:49:41 -0400 Subject: Keep local cached images fresh if file exists. Updates the cache_images() function to `touch` images if the file exists already. Some sites (e.g. news) re-use stock images and this change updates the local file's modified time every time the image is referenced in new articles. This should prevent the local file from being expired/deleted only to be re-cached later on. --- include/rssfuncs.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/rssfuncs.php b/include/rssfuncs.php index a922516cd..7ea0bf0c8 100644 --- a/include/rssfuncs.php +++ b/include/rssfuncs.php @@ -1248,6 +1248,8 @@ if ($file_content && strlen($file_content) > _MIN_CACHE_IMAGE_SIZE) { file_put_contents($local_filename, $file_content); } + } else { + touch($local_filename); } } } -- cgit v1.2.3