summaryrefslogtreecommitdiff
path: root/classes
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2018-08-17 10:11:53 +0300
committerAndrew Dolgov <[email protected]>2018-08-17 10:11:53 +0300
commit04ad631a08e33c30ba506ed07e93f1815434018d (patch)
tree074baeabb80f67ab631adcca3d3ed80c9b47c7f9 /classes
parent611aeb71970b73c070563079b7cc694e191eb358 (diff)
parent3a46529a7329574efd694a6e9fe2828614e7ee2c (diff)
Merge branch 'master' of git.fakecake.org:tt-rss
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) {