mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
Revert #2283
This commit is contained in:
parent
7778cfafed
commit
939991c42f
2 changed files with 4 additions and 4 deletions
|
@ -80,6 +80,10 @@ class SdkClientToken {
|
||||||
* @throws RuntimeException If something unexpected happens.
|
* @throws RuntimeException If something unexpected happens.
|
||||||
*/
|
*/
|
||||||
public function sdk_client_token(): string {
|
public function sdk_client_token(): string {
|
||||||
|
if ( $this->cache->has( self::CACHE_KEY ) ) {
|
||||||
|
return $this->cache->get( self::CACHE_KEY );
|
||||||
|
}
|
||||||
|
|
||||||
// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
|
// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
|
||||||
$domain = wp_unslash( $_SERVER['HTTP_HOST'] ?? '' );
|
$domain = wp_unslash( $_SERVER['HTTP_HOST'] ?? '' );
|
||||||
$domain = preg_replace( '/^www\./', '', $domain );
|
$domain = preg_replace( '/^www\./', '', $domain );
|
||||||
|
|
|
@ -84,10 +84,6 @@ class SavePaymentMethodsModule implements ModuleInterface {
|
||||||
add_filter(
|
add_filter(
|
||||||
'woocommerce_paypal_payments_localized_script_data',
|
'woocommerce_paypal_payments_localized_script_data',
|
||||||
function( array $localized_script_data ) use ( $c ) {
|
function( array $localized_script_data ) use ( $c ) {
|
||||||
if ( ! is_user_logged_in() ) {
|
|
||||||
return $localized_script_data;
|
|
||||||
}
|
|
||||||
|
|
||||||
$api = $c->get( 'api.user-id-token' );
|
$api = $c->get( 'api.user-id-token' );
|
||||||
assert( $api instanceof UserIdToken );
|
assert( $api instanceof UserIdToken );
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue