mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-13 17:45:55 +00:00
cached_url: perform mimetype validation before possible HOOK_SEND_LOCAL_FILE hooks
This commit is contained in:
@@ -1811,15 +1811,6 @@
|
|||||||
|
|
||||||
if (is_writable($filename)) touch($filename);
|
if (is_writable($filename)) touch($filename);
|
||||||
|
|
||||||
$tmppluginhost = new PluginHost();
|
|
||||||
|
|
||||||
$tmppluginhost->load(PLUGINS, PluginHost::KIND_SYSTEM);
|
|
||||||
$tmppluginhost->load_data();
|
|
||||||
|
|
||||||
foreach ($tmppluginhost->get_hooks(PluginHost::HOOK_SEND_LOCAL_FILE) as $plugin) {
|
|
||||||
if ($plugin->hook_send_local_file($filename)) return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
$mimetype = mime_content_type($filename);
|
$mimetype = mime_content_type($filename);
|
||||||
|
|
||||||
// this is hardly ideal but 1) only media is cached in images/ and 2) seemingly only mp4
|
// this is hardly ideal but 1) only media is cached in images/ and 2) seemingly only mp4
|
||||||
@@ -1837,6 +1828,15 @@
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$tmppluginhost = new PluginHost();
|
||||||
|
|
||||||
|
$tmppluginhost->load(PLUGINS, PluginHost::KIND_SYSTEM);
|
||||||
|
$tmppluginhost->load_data();
|
||||||
|
|
||||||
|
foreach ($tmppluginhost->get_hooks(PluginHost::HOOK_SEND_LOCAL_FILE) as $plugin) {
|
||||||
|
if ($plugin->hook_send_local_file($filename)) return true;
|
||||||
|
}
|
||||||
|
|
||||||
header("Content-type: $mimetype");
|
header("Content-type: $mimetype");
|
||||||
|
|
||||||
$stamp = gmdate("D, d M Y H:i:s", filemtime($filename)) . " GMT";
|
$stamp = gmdate("D, d M Y H:i:s", filemtime($filename)) . " GMT";
|
||||||
|
|||||||
Reference in New Issue
Block a user