Merged in bugfix/PMCORE-4148 (pull request #8709)

PMCORE-4148 Validation of uploaded files is currently validating the 'content type' 'application/json'

Approved-by: Julio Cesar Laura Avendaño
This commit is contained in:
Roly Gutierrez
2023-02-01 15:10:27 +00:00
committed by Julio Cesar Laura Avendaño

View File

@@ -260,7 +260,8 @@ class ValidationUploadedFiles
* If the size of post data is greater than post_max_size, the $_POST and $_FILES
* superglobals are empty.
*/
if ($_SERVER['REQUEST_METHOD'] === 'POST' && empty($_POST) && empty($_FILES) && $_SERVER['CONTENT_LENGTH'] > 0) {
$notAppJson = isset($_SERVER['CONTENT_TYPE']) && strtolower($_SERVER['CONTENT_TYPE']) !== 'application/json';
if ($_SERVER['REQUEST_METHOD'] === 'POST' && empty($_POST) && empty($_FILES) && $_SERVER['CONTENT_LENGTH'] > 0 && $notAppJson) {
return true;
}
return false;