mirror of
https://github.com/e107inc/e107.git
synced 2025-07-31 20:00:37 +02:00
Issue #4100 Possible Fix for filename cleaning issue.
This commit is contained in:
@@ -2047,15 +2047,15 @@ class e_media
|
||||
$chunk = isset($_REQUEST["chunk"]) ? intval($_REQUEST["chunk"]) : 0;
|
||||
$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);
|
||||
|
||||
|
||||
if(!empty($_FILES['file']['name']) && $_FILES['file']['name'] !== 'blob' ) // dropzone support v2.1.9
|
||||
{
|
||||
$fileName = $_FILES['file']['name'];
|
||||
}
|
||||
|
||||
// Clean the fileName for security reasons
|
||||
$fileName = preg_replace('/[^\w\._]+/', '_', $fileName);
|
||||
|
||||
// $array = array("jsonrpc" => "2.0", "error" => array('code'=>$_FILES['file']['error'], 'message'=>'Failed to move file'), "id" => "id", 'data'=>$_FILES );
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user