diff options
author | Andreas Fischer <bantu@phpbb.com> | 2012-07-19 17:16:37 +0200 |
---|---|---|
committer | Andreas Fischer <bantu@phpbb.com> | 2012-07-19 17:16:37 +0200 |
commit | c896cd06dd8fba023e2ab6f9cd3f8293d382fb70 (patch) | |
tree | 5d377eaea49356ef3f247cb3f96fad7b87f9f0b0 /phpBB | |
parent | 415a8c678663ae570feda06afa29914afcd4c7b3 (diff) | |
parent | e71474abb5e90d0aeee61d7d9a2d4648aed61426 (diff) | |
download | forums-c896cd06dd8fba023e2ab6f9cd3f8293d382fb70.tar forums-c896cd06dd8fba023e2ab6f9cd3f8293d382fb70.tar.gz forums-c896cd06dd8fba023e2ab6f9cd3f8293d382fb70.tar.bz2 forums-c896cd06dd8fba023e2ab6f9cd3f8293d382fb70.tar.xz forums-c896cd06dd8fba023e2ab6f9cd3f8293d382fb70.zip |
Merge remote-tracking branch 'Fyorl/ticket/10944' into develop
* Fyorl/ticket/10944:
[ticket/10944] strpos now stricter and removed superfluous ternary
[ticket/10944] Reverted changes in PHPBB3-10963
Diffstat (limited to 'phpBB')
-rw-r--r-- | phpBB/includes/functions_upload.php | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/phpBB/includes/functions_upload.php b/phpBB/includes/functions_upload.php index 33cb585b19..d4c6b42cf4 100644 --- a/phpBB/includes/functions_upload.php +++ b/phpBB/includes/functions_upload.php @@ -151,8 +151,7 @@ class filespec */ function is_image() { - $mimetype = $this->get_mimetype($this->filename); - return (strpos($mimetype, 'image/') === 0); + return (strpos($this->mimetype, 'image/') === 0); } /** @@ -201,12 +200,17 @@ class filespec } /** - * Get mimetype. Utilises the finfo class. + * Get mimetype. Utilize mime_content_type if the function exist. + * Not used at the moment... */ function get_mimetype($filename) { - $finfo = new finfo(FILEINFO_MIME_TYPE); - $mimetype = $finfo->file($filename); + $mimetype = ''; + + if (function_exists('mime_content_type')) + { + $mimetype = mime_content_type($filename); + } // Some browsers choke on a mimetype of application/octet-stream if (!$mimetype || $mimetype == 'application/octet-stream') @@ -338,7 +342,6 @@ class filespec // Remove temporary filename @unlink($this->filename); - $this->filename = $this->destination_file; if (sizeof($this->error)) { |