Guzzle PSR-7 3.0 enforces stricter validation for uploaded files.
ServerRequest::withUploadedFiles()
Every leaf in the nested upload tree must be an instance of UploadedFileInterface. Invalid trees are now rejected.
$_FILES Specifications
ServerRequest::normalizeFiles() and ServerRequest::fromGlobals() reject malformed $_FILES arrays.
- Single-file specifications must contain non-null
tmp_name, size, and error values. size and error must be non-negative PHP integers. Numeric strings are no longer cast to integers.- For nested specifications,
tmp_name, size, and error must be arrays, and every key in tmp_name must have a corresponding entry in size and error.
Example of valid 3.0 $_FILES structure:
$files = ['file' => ['tmp_name' => '/tmp/php123', 'size' => 123, 'error' => UPLOAD_ERR_OK]];
// 2.x, no longer accepted in 3.0
$files = ['file' => ['tmp_name' => '/tmp/php123', 'error' => '0']];
// 3.0
$files = ['file' => ['tmp_name' => '/tmp/php123', 'size' => 123, 'error' => UPLOAD_ERR_OK]];