mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-01 07:02:48 +08:00
Merge pull request #307 from ratnakardubey/issue-306-broken-nested-array
Fix: Broken multi-level (nested) associative array values after getting submitted from checkout page
This commit is contained in:
commit
686f6915de
1 changed files with 2 additions and 19 deletions
|
@ -362,17 +362,8 @@ class CreateOrderEndpoint implements EndpointInterface {
|
|||
* @throws Exception On Error.
|
||||
*/
|
||||
private function process_checkout_form( string $form_values ) {
|
||||
$form_values = explode( '&', $form_values );
|
||||
parse_str( $form_values, $parsed_values );
|
||||
|
||||
$parsed_values = array();
|
||||
foreach ( $form_values as $field ) {
|
||||
$field = explode( '=', $field );
|
||||
|
||||
if ( count( $field ) !== 2 ) {
|
||||
continue;
|
||||
}
|
||||
$parsed_values[ $field[0] ] = $field[1];
|
||||
}
|
||||
$_POST = $parsed_values;
|
||||
$_REQUEST = $parsed_values;
|
||||
|
||||
|
@ -412,16 +403,8 @@ class CreateOrderEndpoint implements EndpointInterface {
|
|||
* @throws Exception On Error.
|
||||
*/
|
||||
private function process_checkout_form_when_creating_account( string $form_values, \WC_Order $wc_order = null ) {
|
||||
$form_values = explode( '&', $form_values );
|
||||
$parsed_values = array();
|
||||
foreach ( $form_values as $field ) {
|
||||
$field = explode( '=', $field );
|
||||
parse_str( $form_values, $parsed_values );
|
||||
|
||||
if ( count( $field ) !== 2 ) {
|
||||
continue;
|
||||
}
|
||||
$parsed_values[ $field[0] ] = $field[1];
|
||||
}
|
||||
$_POST = $parsed_values;
|
||||
$_REQUEST = $parsed_values;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue