From: Andrew Dolgov Date: Thu, 23 Mar 2017 15:26:43 +0000 (+0300) Subject: add cosmetic suffixes back for cached url links X-Git-Tag: 17.4~9 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=9594ea68751c7f887dfabcf4e1411a2da1283ed5;p=tt-rss.git add cosmetic suffixes back for cached url links --- diff --git a/include/functions2.php b/include/functions2.php index 28e182f8..84469365 100644 --- a/include/functions2.php +++ b/include/functions2.php @@ -912,7 +912,19 @@ $cached_filename = CACHE_DIR . '/images/' . sha1($src); if (file_exists($cached_filename)) { - $src = get_self_url_prefix() . '/public.php?op=cached_url&hash=' . sha1($src); + + // this is strictly cosmetic + if ($entry->tagName == 'img') { + $suffix = ".png"; + } else if ($entry->parentNode && $entry->parentNode->tagName == "video") { + $suffix = ".mp4"; + } else if ($entry->parentNode && $entry->parentNode->tagName == "audio") { + $suffix = ".ogg"; + } else { + $suffix = ""; + } + + $src = get_self_url_prefix() . '/public.php?op=cached_url&hash=' . sha1($src) . $suffix; if ($entry->hasAttribute('srcset')) { $entry->removeAttribute('srcset');