summaryrefslogtreecommitdiff
path: root/include/functions.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2019-08-13 12:39:21 +0300
committerAndrew Dolgov <[email protected]>2019-08-13 12:39:21 +0300
commitb1dd38f880d843dad92f0d76838edd40f1bf687b (patch)
tree5a765e132ce74911e0b68596fa51118e4ee0f7a0 /include/functions.php
parent7602819b9825ffe2013e214b6d072ae798d5541a (diff)
add DiskCache.getUrl() and use it in a bunch of places
Diffstat (limited to 'include/functions.php')
-rw-r--r--include/functions.php15
1 files changed, 1 insertions, 14 deletions
diff --git a/include/functions.php b/include/functions.php
index 80ae3fe7e..b63f8725e 100644
--- a/include/functions.php
+++ b/include/functions.php
@@ -1258,20 +1258,7 @@
if (file_exists($cached_filename)) {
- // this is strictly cosmetic
- if ($entry->tagName == 'img') {
- $suffix = ".png";
- } else if ($entry->parentNode && $entry->parentNode->tagName == "picture") {
- $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;
+ $src = DiskCache::getUrl(sha1($src));
if ($entry->hasAttribute('poster'))
$entry->setAttribute('poster', $src);