From 41bead9baa6ae6fa84834ec291167fdc780b1e63 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 23 Mar 2017 14:55:40 +0300 Subject: remove local file extensions and generalize some method names for cached media file extensions may still be present in urls, but are ignored by the backend MIGRATION (if you have any cached data worth keeping, not required): in cache/images run "rename 's/\..*$//' *" i.e. strip file extensions --- include/functions2.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include/functions2.php') diff --git a/include/functions2.php b/include/functions2.php index 34f027a55..39c7f746b 100644 --- a/include/functions2.php +++ b/include/functions2.php @@ -913,11 +913,11 @@ // check cache only for video and images for the time being if ($entry->nodeName == 'img' || ($entry->parentNode && $entry->parentNode->nodeName == "video")) { + $cached_filename = CACHE_DIR . '/images/' . sha1($src); $extension = $entry->tagName == 'source' ? '.mp4' : '.png'; - $cached_filename = CACHE_DIR . '/images/' . sha1($src) . $extension; if (file_exists($cached_filename)) { - $src = get_self_url_prefix() . '/public.php?op=cached_image&hash=' . sha1($src) . $extension; + $src = get_self_url_prefix() . '/public.php?op=cached_url&hash=' . sha1($src) . $extension; if ($entry->hasAttribute('srcset')) { $entry->removeAttribute('srcset'); -- cgit v1.2.3