Skip to content

Commit

Permalink
Remove accidental double encoding of JSON data.
Browse files Browse the repository at this point in the history
  • Loading branch information
brettshumaker committed Feb 27, 2025
1 parent c9c83d9 commit 13fec88
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions includes/admin/class-wc-payments-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,7 @@ public function enqueue_payments_scripts() {
$this->get_js_settings()
);

$payment_method_definitions = rawurlencode( wp_json_encode( PaymentMethodUtils::get_payment_method_definitions_json() ) );
$payment_method_definitions = rawurlencode( PaymentMethodUtils::get_payment_method_definitions_json() );
wp_add_inline_script(
'WCPAY_ADMIN_SETTINGS',
"const woopaymentsPaymentMethodDefinitions = JSON.parse( decodeURIComponent( '" . esc_js( $payment_method_definitions ) . "' ) );",
Expand Down Expand Up @@ -692,7 +692,7 @@ public function enqueue_payments_scripts() {
$this->get_js_settings()
);

$payment_method_definitions = rawurlencode( wp_json_encode( PaymentMethodUtils::get_payment_method_definitions_json() ) );
$payment_method_definitions = rawurlencode( PaymentMethodUtils::get_payment_method_definitions_json() );
wp_add_inline_script(
'WCPAY_DASH_APP',
"const woopaymentsPaymentMethodDefinitions = JSON.parse( decodeURIComponent( '" . esc_js( $payment_method_definitions ) . "' ) );",
Expand Down

0 comments on commit 13fec88

Please sign in to comment.