diff options
author | Christian Grothoff <christian@grothoff.org> | 2020-10-13 19:01:19 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2020-10-13 19:01:19 +0200 |
commit | e6d29b704b5eb7e557c1200cd08e1c1327ffb21a (patch) | |
tree | 5232dd85a3addeedd4dc59e64efc79a9c2720a31 | |
parent | cd4fc020aaac8df9a0f03e3ea2e053eee40423b2 (diff) | |
download | woocommerce-taler-e6d29b704b5eb7e557c1200cd08e1c1327ffb21a.tar.gz woocommerce-taler-e6d29b704b5eb7e557c1200cd08e1c1327ffb21a.tar.bz2 woocommerce-taler-e6d29b704b5eb7e557c1200cd08e1c1327ffb21a.zip |
fix redirect to checkout page upon OIDC login
-rwxr-xr-x | daggerhart-openid-connect-generic/includes/openid-connect-generic-login-form.php | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/daggerhart-openid-connect-generic/includes/openid-connect-generic-login-form.php b/daggerhart-openid-connect-generic/includes/openid-connect-generic-login-form.php index 76107b0..a3b9804 100755 --- a/daggerhart-openid-connect-generic/includes/openid-connect-generic-login-form.php +++ b/daggerhart-openid-connect-generic/includes/openid-connect-generic-login-form.php @@ -142,27 +142,27 @@ class OpenID_Connect_Generic_Login_Form { (array_key_exists ('address', $token_response)) ){ $address = $token_response [ 'address' ]; echo "OIDC has address: " . json_encode ( $address ); // DEBUG - if ( in_array( 'postal_code', $address ) ){ + if ( array_key_exists( 'postal_code', $address ) ){ $postal_code = $address [ 'postal_code' ]; $in['billing']['billing_postcode']['default'] = $postal_code; $in['shipping']['shipping_postcode']['default'] = $postal_code; } - if ( in_array( 'country', $address ) ){ + if ( array_key_exists( 'country', $address ) ){ $country = $address [ 'country' ]; $in['billing']['billing_country']['default'] = $country; $in['shipping']['shipping_country']['default'] = $country; } - if ( in_array( 'locality', $address ) ){ + if ( array_key_exists( 'locality', $address ) ){ $locality = $address [ 'locality' ]; $in['billing']['billing_city']['default'] = $locality; $in['shipping']['shipping_city']['default'] = $locality; } - if ( in_array ( 'region', $address ) ){ + if ( array_key_exists ( 'region', $address ) ){ $region = $address [ 'region' ]; $in['billing']['billing_state']['default'] = $region; $in['shipping']['shipping_state']['default'] = $region; } - if ( in_array ( 'formatted', $address ) ){ + if ( array_key_exists ( 'formatted', $address ) ){ $formatted = $address [ 'formatted' ]; $lines = explode ( '\r\n', $formatted ); if ( count($lines) > 0 ){ @@ -174,9 +174,9 @@ class OpenID_Connect_Generic_Login_Form { $in['shipping']['shipping_address_2']['default'] = $lines[1]; } } - if ( in_array ( 'street_address', $address ) ){ + if ( array_key_exists ( 'street_address', $address ) ){ $street_address = $address [ 'street_address' ]; - if ( ! in_array ( 'formatted', $address ) ){ + if ( ! array_key_exists ( 'formatted', $address ) ){ $in['billing']['billing_address_1']['default'] = $street_address; $in['shipping']['shipping_address_1']['default'] = $street_address; } |