summaryrefslogtreecommitdiff
path: root/classes/handler
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2017-03-23 14:55:40 +0300
committerAndrew Dolgov <[email protected]>2017-03-23 14:55:40 +0300
commit41bead9baa6ae6fa84834ec291167fdc780b1e63 (patch)
tree309fea4ed8ee1439b02b79a1f6011a82f29da289 /classes/handler
parent63f0ed3d9c9cd73f9cc63f08e88b8cfbfe254793 (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 'classes/handler')
-rw-r--r--classes/handler/public.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/classes/handler/public.php b/classes/handler/public.php
index 35f677f94..a6bc3ff6f 100644
--- a/classes/handler/public.php
+++ b/classes/handler/public.php
@@ -1046,9 +1046,12 @@ class Handler_Public extends Handler {
<?php
}
- function cached_image() {
+ function cached_url() {
@$hash = basename($_GET['hash']);
+ // we don't need an extension to find the file, hash is a complete URL
+ $hash = preg_replace("/\.[^\.]*$/", "", $hash);
+
if ($hash) {
$filename = CACHE_DIR . '/images/' . $hash;