Skip to content
Permalink
Browse files Browse the repository at this point in the history
plupload fix.
  • Loading branch information
CaMer0n committed Aug 10, 2018
1 parent cc6155a commit e5bb529
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions e107_web/js/plupload/upload.php
Expand Up @@ -46,13 +46,9 @@
$chunks = isset($_REQUEST["chunks"]) ? intval($_REQUEST["chunks"]) : 0;
$fileName = isset($_REQUEST["name"]) ? $_REQUEST["name"] : '';



// Clean the fileName for security reasons
$fileName = preg_replace('/[^\w\._]+/', '_', $fileName);

$fileName= 'hello.jpg';

if(!empty($_FILES['file']['name'])) // dropzone support v2.1.9
{
$fileName = $_FILES['file']['name'];
Expand Down Expand Up @@ -195,6 +191,14 @@

$filePath = str_replace('//','/',$filePath); // cleanup .


if(e107::getFile()->isClean($filePath) !== true)
{
@unlink($filePath);
die('{"jsonrpc" : "2.0", "error" : {"code": 103, "message": "Bad File Detected."}, "id" : "id"}');
}


$convertToJpeg = e107::getPref('convert_to_jpeg', 0);
$fileSize = filesize($filePath);

Expand All @@ -209,6 +213,9 @@

}




if($_GET['for'] != '') // leave in upload directory if no category given.
{
$uploadPath = varset($_GET['path'],null);
Expand Down

0 comments on commit e5bb529

Please sign in to comment.