1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-25 15:31:28 +00:00

Merge branch 'master' of git.fakecake.org:tt-rss

This commit is contained in:
Andrew Dolgov
2018-08-17 10:11:53 +03:00
6 changed files with 16 additions and 13 deletions

6
classes/handler/public.php Normal file → Executable file
View File

@@ -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);

View File

@@ -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) {