Skip to content

Commit 0cbad51

Browse files
committed
Merge branch 'master' of https://github.com/joanhey/AdapterMan
2 parents 0325b56 + 4cc6223 commit 0cbad51

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Http.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,7 @@ protected static function parseUploadFiles(string $http_body, string $http_post_
488488
unset($boundary_data_array[0]);
489489
}
490490
$key = -1;
491+
$post_encode_string = '';
491492
foreach ($boundary_data_array as $boundary_data_buffer) {
492493
list($boundary_header_buffer, $boundary_value) = \explode("\r\n\r\n", $boundary_data_buffer, 2);
493494
// Remove \r\n from the end of buffer.
@@ -512,7 +513,7 @@ protected static function parseUploadFiles(string $http_body, string $http_post_
512513
else {
513514
// Parse $_POST.
514515
if (\preg_match('/name="(.*?)"$/', $header_value, $match)) {
515-
$_POST[$match[1]] = $boundary_value;
516+
$post_encode_string .= urlencode($match[1]) . '=' . urlencode($boundary_value) . '&';
516517
}
517518
}
518519
break;
@@ -522,6 +523,9 @@ protected static function parseUploadFiles(string $http_body, string $http_post_
522523
break;
523524
}
524525
}
526+
if($post_encode_string) {
527+
\parse_str($post_encode_string, $_POST);
528+
}
525529
}
526530
}
527531

0 commit comments

Comments
 (0)