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

This commit is contained in:
Roly Gutierrez
2023-02-01 10:38:44 -04:00
parent d8cbe0bd66
commit a0e45fff80

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;