Close the mime checker after use

This commit is contained in:
Starbeamrainbowlabs 2015-10-22 08:44:55 +01:00
parent aea3294c92
commit e09533659a
3 changed files with 3 additions and 1 deletions

View File

@ -1282,6 +1282,7 @@ register_module([
$mimechecker = finfo_open(FILEINFO_MIME_TYPE);
$mime_type = finfo_file($mimechecker, $temp_filename);
finfo_close($mimechecker);
// Perform appropriate checks based on the *real* filetype
switch(substr($mime_type, 0, strpos($mime_type, "/")))

View File

@ -50,7 +50,7 @@
"author": "Starbeamrainbowlabs",
"description": "Adds the ability to upload files to Pepperminty Wiki. Uploaded files act as pages and have the special 'File:' prefix.",
"id": "feature-upload",
"lastupdate": 1445499784,
"lastupdate": 1445499882,
"optional": false
},
{

View File

@ -64,6 +64,7 @@ register_module([
$mimechecker = finfo_open(FILEINFO_MIME_TYPE);
$mime_type = finfo_file($mimechecker, $temp_filename);
finfo_close($mimechecker);
// Perform appropriate checks based on the *real* filetype
switch(substr($mime_type, 0, strpos($mime_type, "/")))