diff options
author | Andrew Dolgov <[email protected]> | 2017-03-23 14:55:40 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2017-03-23 14:55:40 +0300 |
commit | 41bead9baa6ae6fa84834ec291167fdc780b1e63 (patch) | |
tree | 309fea4ed8ee1439b02b79a1f6011a82f29da289 /include/functions2.php | |
parent | 63f0ed3d9c9cd73f9cc63f08e88b8cfbfe254793 (diff) |
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
Diffstat (limited to 'include/functions2.php')
-rw-r--r-- | include/functions2.php | 4 |
1 files changed, 2 insertions, 2 deletions
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'); |