From 7d49e21792297a79566241aa0f5e76a1b5734711 Mon Sep 17 00:00:00 2001 From: Daku Date: Sun, 5 Jan 2014 11:52:09 +0000 Subject: [PATCH] readability + moved stuff --- core/util.inc.php | 47 +++++++++++++++++++++++----------------------- ext/index/main.php | 5 +++-- 2 files changed, 27 insertions(+), 25 deletions(-) diff --git a/core/util.inc.php b/core/util.inc.php index b63c0d43..09dbe7fe 100644 --- a/core/util.inc.php +++ b/core/util.inc.php @@ -556,6 +556,30 @@ function getMimeType($file, $ext="") { return 'application/octet-stream'; } + +function getExtension ($mime_type){ + if(empty($mime_type)){ + return false; + } + + $extensions = array( + 'image/jpeg' => 'jpg', + 'image/gif' => 'gif', + 'image/png' => 'png', + 'application/x-shockwave-flash' => 'swf', + 'image/x-icon' => 'ico', + 'image/svg+xml' => 'svg', + 'audio/mpeg' => 'mp3', + 'video/x-flv' => 'flv', + 'audio/mp4' => 'mp4', + 'video/mp4' => 'mp4', + 'audio/webm' => 'webm', + 'video/webm' => 'webm' + ); + + return $extensions[$mime_type]; +} + /** * @private */ @@ -877,29 +901,6 @@ if (!function_exists('http_parse_headers')) { #http://www.php.net/manual/en/func } } -function getExtension ($mime_type){ - if(empty($mime_type)){ - return false; - } - - $extensions = array( - 'image/jpeg' => 'jpg', - 'image/gif' => 'gif', - 'image/png' => 'png', - 'application/x-shockwave-flash' => 'swf', - 'image/x-icon' => 'ico', - 'image/svg+xml' => 'svg', - 'audio/mpeg' => 'mp3', - 'video/x-flv' => 'flv', - 'audio/mp4' => 'mp4', - 'video/mp4' => 'mp4', - 'audio/webm' => 'webm', - 'video/webm' => 'webm' - ); - - return $extensions[$mime_type]; -} - $_included = array(); /** * Get the active contents of a .php file diff --git a/ext/index/main.php b/ext/index/main.php index 1831ec68..45f71f02 100644 --- a/ext/index/main.php +++ b/ext/index/main.php @@ -87,7 +87,7 @@ * - *
  • order (id, width, height, filesize, filename)_(ASC, DESC), eg + *
  • order=(id, width, height, filesize, filename)_(ASC, DESC), eg *