X-Git-Url: https://git.p6c8.net/jirafeau_mojo42.git/blobdiff_plain/8665ea5fc150ca65125f24023b545fe39bdb2a95..03f216f58de659215008347947a754096902771e:/lib/functions.php?ds=sidebyside diff --git a/lib/functions.php b/lib/functions.php index f564db6..c831b73 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)) { + return true; + } + $viewable = array('text/plain'); + if (in_array($mime, $viewable)) { + return true; + } } return false; }