aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/files/type
diff options
context:
space:
mode:
authorJens-Christian Fischer <jens-christian.fischer@switch.ch>2014-02-04 17:03:52 +0100
committerJens-Christian Fischer <jens-christian.fischer@switch.ch>2014-02-04 17:03:52 +0100
commit11f46e121caa30f46250a1980e315520d68eb593 (patch)
treef565ccefa12c1d51ffa72f2d74c903072c3ce76a /lib/private/files/type
parent49f0f9f2f67c3494628f14c7a5c383596879ec12 (diff)
downloadnextcloud-server-11f46e121caa30f46250a1980e315520d68eb593.tar.gz
nextcloud-server-11f46e121caa30f46250a1980e315520d68eb593.zip
close statement in MimeType detection is executed [#7069]
close statement was never executed due to it being after a return statement.
Diffstat (limited to 'lib/private/files/type')
-rw-r--r--lib/private/files/type/detection.php3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/private/files/type/detection.php b/lib/private/files/type/detection.php
index d7cc9ebbf4e..11e439032ce 100644
--- a/lib/private/files/type/detection.php
+++ b/lib/private/files/type/detection.php
@@ -72,11 +72,12 @@ class Detection {
and function_exists('finfo_file') and $finfo = finfo_open(FILEINFO_MIME)
) {
$info = @strtolower(finfo_file($finfo, $path));
+ finfo_close($finfo);
if ($info) {
$mimeType = substr($info, 0, strpos($info, ';'));
return empty($mimeType) ? 'application/octet-stream' : $mimeType;
}
- finfo_close($finfo);
+
}
$isWrapped = (strpos($path, '://') !== false) and (substr($path, 0, 7) === 'file://');
if (!$isWrapped and $mimeType === 'application/octet-stream' && function_exists("mime_content_type")) {