From fa77552e57052ace01abef279e0a8cf3946083e2 Mon Sep 17 00:00:00 2001 From: Adam Vessey Date: Wed, 25 Apr 2012 09:22:14 -0300 Subject: [PATCH] Get the extension without exploding. --- MimeClass.inc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/MimeClass.inc b/MimeClass.inc index 42c11e37..b2950f6e 100644 --- a/MimeClass.inc +++ b/MimeClass.inc @@ -231,9 +231,7 @@ class MimeClass { * @return type */ public function get_mimetype($filename, $debug = FALSE) { - - $file_name_and_extension = explode('.', $filename); - $ext = strtolower(array_pop($file_name_and_extension)); + $ext = strtolower(substr($filename, strrpos($filename, '.') + 1)); if (!empty($this->private_mime_types[$ext])) { if (TRUE === $debug)