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

master
Andrew Dolgov 6 years ago
commit 04ad631a08

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

@ -23,12 +23,6 @@
// location of tt-rss directory, e.g. http://example.org/tt-rss/
// You need to set this option correctly otherwise several features
// including PUSH, bookmarklets and browser integration will not work properly.
// Key used for encryption of passwords for password-protected feeds
// in the database. A string of 24 random characters. If left blank, encryption
// is not used. Requires mcrypt functions.
// Warning: changing this key will make your stored feed passwords impossible
// to decrypt.
define('SINGLE_USER_MODE', false);
// Operate in single user mode, disables all functionality related to

File diff suppressed because one or more lines are too long

@ -72,8 +72,8 @@ body.ttrss_zoom {
line-height : 1.5;
padding : 10px;
img {
max-width : 730px;
img, video {
max-width : 760px;
height : auto;
}

@ -2574,6 +2574,13 @@
}
$mimetype = mime_content_type($filename);
// this is hardly ideal but 1) only media is cached in images/ and 2) seemingly only mp4
// video files are detected as octet-stream by mime_content_type()
if ($mimetype == "application/octet-stream")
$mimetype = "video/mp4";
header("Content-type: $mimetype");
$stamp = gmdate("D, d M Y H:i:s", filemtime($filename)) . " GMT";

Loading…
Cancel
Save