summaryrefslogtreecommitdiff
path: root/classes
diff options
context:
space:
mode:
Diffstat (limited to 'classes')
-rwxr-xr-x[-rw-r--r--]classes/handler/public.php6
-rwxr-xr-xclasses/rssutils.php4
2 files changed, 6 insertions, 4 deletions
diff --git a/classes/handler/public.php b/classes/handler/public.php
index 8440bc355..e892a9797 100644..100755
--- a/classes/handler/public.php
+++ b/classes/handler/public.php
@@ -934,17 +934,17 @@ class Handler_Public extends Handler {
}
function cached_url() {
- @$hash = basename($_GET['hash']);
+ @$req_filename = basename($_GET['hash']);
// we don't need an extension to find the file, hash is a complete URL
- $hash = preg_replace("/\.[^\.]*$/", "", $hash);
+ $hash = preg_replace("/\.[^\.]*$/", "", $req_filename);
if ($hash) {
$filename = CACHE_DIR . '/images/' . $hash;
if (file_exists($filename)) {
- header("Content-Disposition: inline; filename=\"$hash\"");
+ header("Content-Disposition: inline; filename=\"$req_filename\"");
send_local_file($filename);
diff --git a/classes/rssutils.php b/classes/rssutils.php
index bd20a6b48..554d89f5a 100755
--- a/classes/rssutils.php
+++ b/classes/rssutils.php
@@ -1239,9 +1239,11 @@ class RSSUtils {
$local_filename = CACHE_DIR . "/images/" . sha1($src);
- if ($debug) _debug("cache_media: downloading: $src to $local_filename");
+ if ($debug) _debug("cache_media: checking $src");
if (!file_exists($local_filename)) {
+ if ($debug) _debug("cache_media: downloading: $src to $local_filename");
+
$file_content = fetch_file_contents($src);
if ($file_content && strlen($file_content) > MIN_CACHE_FILE_SIZE) {