X-Git-Url: https://git.p6c8.net/jirafeau.git/blobdiff_plain/2bc76d8baee16b7ba0814c12da52c665158a6d98..6d6c111b80ad13201b7acd7c2f5b8fd6d160e11b:/lib/functions.php diff --git a/lib/functions.php b/lib/functions.php index f564db6..6e5c886 100644 --- a/lib/functions.php +++ b/lib/functions.php @@ -509,10 +509,15 @@ function jirafeau_upload($file, $one_time_download, $key, $time, $ip, $crypt, $l function jirafeau_is_viewable($mime) { if (!empty($mime)) { - /* Actually, verify if mime-type is an image or a text. */ - $viewable = array('image', 'text', 'video', 'audio'); + $viewable = array('image', 'video', 'audio'); $decomposed = explode('/', $mime); - return in_array($decomposed[0], $viewable); + if (in_array($decomposed[0], $viewable) && strpos($mime, 'image/svg+xml') === false) { + return true; + } + $viewable = array('text/plain'); + if (in_array($mime, $viewable)) { + return true; + } } return false; }