mirror of
https://github.com/sbrl/Pepperminty-Wiki.git
synced 2024-12-22 13:45:02 +00:00
Bugfix: Check imagesize correctly
This commit is contained in:
parent
e09533659a
commit
15885200eb
3 changed files with 5 additions and 5 deletions
|
@ -1290,9 +1290,9 @@ register_module([
|
|||
case "image":
|
||||
$extra_data = [];
|
||||
$imagesize = getimagesize($temp_filename, $extra_data);
|
||||
|
||||
var_dump($imagesize);
|
||||
// Make sure that the image size is defined
|
||||
if(!is_int($imagesize[0]) or !is_int($imagesize))
|
||||
if(!is_int($imagesize[0]) or !is_int($imagesize[1]))
|
||||
exit(page_renderer::render("Upload Error - $settings->sitename", "<p>The file that you uploaded doesn't appear to be an image. $settings->sitename currently only supports uploading images (videos coming soon). <a href='?action=upload'>Go back to try again</a>.</p>"));
|
||||
|
||||
break;
|
||||
|
|
|
@ -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": 1445499882,
|
||||
"lastupdate": 1445500026,
|
||||
"optional": false
|
||||
},
|
||||
{
|
||||
|
|
|
@ -72,9 +72,9 @@ register_module([
|
|||
case "image":
|
||||
$extra_data = [];
|
||||
$imagesize = getimagesize($temp_filename, $extra_data);
|
||||
|
||||
var_dump($imagesize);
|
||||
// Make sure that the image size is defined
|
||||
if(!is_int($imagesize[0]) or !is_int($imagesize))
|
||||
if(!is_int($imagesize[0]) or !is_int($imagesize[1]))
|
||||
exit(page_renderer::render("Upload Error - $settings->sitename", "<p>The file that you uploaded doesn't appear to be an image. $settings->sitename currently only supports uploading images (videos coming soon). <a href='?action=upload'>Go back to try again</a>.</p>"));
|
||||
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue