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 /classes/handler/public.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 'classes/handler/public.php')
-rw-r--r-- | classes/handler/public.php | 5 |
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; |