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:
6
classes/handler/public.php
Normal file → Executable file
6
classes/handler/public.php
Normal file → Executable 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);
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user