Add request_parse_body() function

RFC: https://wiki.php.net/rfc/rfc1867-non-post

This function allows populating the $_POST and $_FILES globals for non-post
requests. This avoids manual parsing of RFC1867 requests.

Fixes #55815
Closes GH-11472
This commit is contained in:
Ilija Tovilo 2023-06-17 22:26:21 +02:00
parent 2f894389b6
commit cd66fcc68b
No known key found for this signature in database
GPG key ID: A4F5D403F118200A
41 changed files with 995 additions and 45 deletions

View file

@ -42,6 +42,7 @@ ZEND_API zend_class_entry *zend_ce_value_error;
ZEND_API zend_class_entry *zend_ce_arithmetic_error;
ZEND_API zend_class_entry *zend_ce_division_by_zero_error;
ZEND_API zend_class_entry *zend_ce_unhandled_match_error;
ZEND_API zend_class_entry *zend_ce_request_parse_body_exception;
/* Internal pseudo-exception that is not exposed to userland. Throwing this exception *does not* execute finally blocks. */
static zend_class_entry zend_ce_unwind_exit;
@ -788,6 +789,9 @@ void zend_register_default_exception(void) /* {{{ */
zend_ce_unhandled_match_error = register_class_UnhandledMatchError(zend_ce_error);
zend_init_exception_class_entry(zend_ce_unhandled_match_error);
zend_ce_request_parse_body_exception = register_class_RequestParseBodyException(zend_ce_exception);
zend_init_exception_class_entry(zend_ce_request_parse_body_exception);
INIT_CLASS_ENTRY(zend_ce_unwind_exit, "UnwindExit", NULL);
INIT_CLASS_ENTRY(zend_ce_graceful_exit, "GracefulExit", NULL);