mirror of
https://github.com/sbrl/Pepperminty-Wiki.git
synced 2024-11-22 04:23:01 +00:00
Close the mime checker after use
This commit is contained in:
parent
aea3294c92
commit
e09533659a
3 changed files with 3 additions and 1 deletions
|
@ -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, "/")))
|
||||||
|
|
|
@ -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
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
@ -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, "/")))
|
||||||
|
|
Loading…
Reference in a new issue