diff options
author | 2018-09-15 14:46:11 +0200 | |
---|---|---|
committer | 2018-09-15 14:46:11 +0200 | |
commit | ae45a8cfeee63626eecb55b5fce0390c91ff9087 (patch) | |
tree | 62234ff3b8a0ddd013d53cc9475ddb4d9e4f3ffc /lib/contents.php | |
parent | e34ef6cb4f77a6360debc73f147a44191d533a2b (diff) | |
download | rss-bridge-ae45a8cfeee63626eecb55b5fce0390c91ff9087.tar.gz rss-bridge-ae45a8cfeee63626eecb55b5fce0390c91ff9087.tar.zst rss-bridge-ae45a8cfeee63626eecb55b5fce0390c91ff9087.zip |
[contents] Fix open_basedir warning (#832)
References #818
Diffstat (limited to 'lib/contents.php')
-rw-r--r-- | lib/contents.php | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/contents.php b/lib/contents.php index 00202c44..ca0ef8bc 100644 --- a/lib/contents.php +++ b/lib/contents.php @@ -163,13 +163,15 @@ function getMimeType($url) { static $mime = null; if (is_null($mime)) { + // Default values, overriden by /etc/mime.types when present $mime = array( 'jpg' => 'image/jpeg', 'gif' => 'image/gif', 'png' => 'image/png', 'image' => 'image/*' ); - if (is_file('/etc/mime.types')) { + // '@' is used to mute open_basedir warning, see issue #818 + if (@is_readable('/etc/mime.types')) { $file = fopen('/etc/mime.types', 'r'); while(($line = fgets($file)) !== false) { $line = trim(preg_replace('/#.*/', '', $line)); |