diff options
author | Andrew Dolgov <[email protected]> | 2019-08-13 12:39:21 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2019-08-13 12:39:21 +0300 |
commit | b1dd38f880d843dad92f0d76838edd40f1bf687b (patch) | |
tree | 5a765e132ce74911e0b68596fa51118e4ee0f7a0 /include/functions.php | |
parent | 7602819b9825ffe2013e214b6d072ae798d5541a (diff) |
add DiskCache.getUrl() and use it in a bunch of places
Diffstat (limited to 'include/functions.php')
-rw-r--r-- | include/functions.php | 15 |
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); |