1
0
Fork 0
mirror of https://github.com/sbrl/Pepperminty-Wiki.git synced 2024-11-22 16:33:00 +00:00

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); $mimechecker = finfo_open(FILEINFO_MIME_TYPE);
$mime_type = finfo_file($mimechecker, $temp_filename); $mime_type = finfo_file($mimechecker, $temp_filename);
finfo_close($mimechecker);
// Perform appropriate checks based on the *real* filetype // Perform appropriate checks based on the *real* filetype
switch(substr($mime_type, 0, strpos($mime_type, "/"))) switch(substr($mime_type, 0, strpos($mime_type, "/")))

View file

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

View file

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