mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-04-10 17:08:47 +00:00
fix: dont read /etc if open_basedir #4502
This commit is contained in:
parent
db42f2786c
commit
b289f1c3c4
@ -175,6 +175,9 @@ function parse_mime_type($url)
|
|||||||
'image' => 'image/*',
|
'image' => 'image/*',
|
||||||
'mp3' => 'audio/mpeg',
|
'mp3' => 'audio/mpeg',
|
||||||
];
|
];
|
||||||
|
// if-check to avoid excessive php errors about open_basedir restriction (#4502)
|
||||||
|
$open_basedir = ini_get('open_basedir');
|
||||||
|
if (! $open_basedir) {
|
||||||
// '@' is used to mute open_basedir warning, see issue #818
|
// '@' is used to mute open_basedir warning, see issue #818
|
||||||
if (@is_readable('/etc/mime.types')) {
|
if (@is_readable('/etc/mime.types')) {
|
||||||
$file = fopen('/etc/mime.types', 'r');
|
$file = fopen('/etc/mime.types', 'r');
|
||||||
@ -195,6 +198,7 @@ function parse_mime_type($url)
|
|||||||
fclose($file);
|
fclose($file);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (strpos($url, '?') !== false) {
|
if (strpos($url, '?') !== false) {
|
||||||
$url_temp = substr($url, 0, strpos($url, '?'));
|
$url_temp = substr($url, 0, strpos($url, '?'));
|
||||||
|
Loading…
Reference in New Issue
Block a user