| @@ -5684,9 +5684,9 @@ | ||
| 5684 | 5684 | params.append("card_name",document.getElementById("card_name").value); |
| 5685 | 5685 | params.append("sendid",document.getElementById("sendid").value); |
| 5686 | 5686 | params.append("sendpoint",document.getElementById("sendpoint").value); |
| 5687 | 5687 | params.append("_nonce","<?php echo esc_attr( wp_create_nonce( 'acting_zeus_card' ) ); ?>"); |
| 5688 | - return fetch( uscesL10n.ajaxurl+"?uscesid="+uscesL10n.uscesid, { | |
| 5688 | + return fetch( uscesL10n.ajaxurl, { | |
| 5689 | 5689 | method:'POST', |
| 5690 | 5690 | cache:'no-cache', |
| 5691 | 5691 | body:params |
| 5692 | 5692 | }).then( function(res) { |
| @@ -6816,9 +6816,9 @@ | ||
| 6816 | 6816 | $optstr = ''; |
| 6817 | 6817 | foreach ( $options as $key => $value ) { |
| 6818 | 6818 | if ( ! empty( $key ) ) { |
| 6819 | 6819 | $key = urldecode( $key ); |
| 6820 | - $value = maybe_unserialize( $value ); | |
| 6820 | + $value = wel_safe_maybe_unserialize( $value ); | |
| 6821 | 6821 | if ( is_array( $value ) ) { |
| 6822 | 6822 | $c = ''; |
| 6823 | 6823 | $optstr .= '( ' . $key . ' : '; |
| 6824 | 6824 | foreach ( $value as $v ) { |
| @@ -6898,9 +6898,9 @@ | ||
| 6898 | 6898 | $optstr = ''; |
| 6899 | 6899 | foreach ( $options as $key => $value ) { |
| 6900 | 6900 | if ( ! empty( $key ) ) { |
| 6901 | 6901 | $key = urldecode( $key ); |
| 6902 | - $value = maybe_unserialize( $value ); | |
| 6902 | + $value = wel_safe_maybe_unserialize( $value ); | |
| 6903 | 6903 | if ( is_array( $value ) ) { |
| 6904 | 6904 | $c = ''; |
| 6905 | 6905 | $optstr .= '( ' . $key . ' : '; |
| 6906 | 6906 | foreach ( $value as $v ) { |
| @@ -7107,8 +7107,22 @@ | ||
| 7107 | 7107 | global $usces; |
| 7108 | 7108 | |
| 7109 | 7109 | check_ajax_referer( 'acting_zeus_card', '_nonce' ); |
| 7110 | 7110 | |
| 7111 | + // A6 (Layer 3 / uscesid removal): この nopriv admin-ajax は usces_close_session()(admin_init) | |
| 7112 | + // の後に走るため session_status() は PHP_SESSION_NONE。旧実装は JS が付けた `?uscesid=` を | |
| 7113 | + // usces_session_start() が復号して買い物客セッションへ切替えていたが、uscesid を廃し、 | |
| 7114 | + // 同一オリジンの USCES_KEY cookie から買い物客セッションを再開する(A2 と同一方式). | |
| 7115 | + if ( PHP_SESSION_NONE === session_status() ) { | |
| 7116 | + $usces_options = get_option( 'usces' ); | |
| 7117 | + $sess_name = defined( 'USCES_KEY' ) ? USCES_KEY : ( isset( $usces_options['usces_key'] ) ? $usces_options['usces_key'] : '' ); | |
| 7118 | + if ( '' !== $sess_name && ! empty( $_COOKIE[ $sess_name ] ) ) { | |
| 7119 | + $sess_id = preg_replace( '/[^A-Za-z0-9,\-]/', '', wp_unslash( $_COOKIE[ $sess_name ] ) ); | |
| 7120 | + session_id( $sess_id ); | |
| 7121 | + @session_start(); // phpcs:ignore | |
| 7122 | + } | |
| 7123 | + } | |
| 7124 | + | |
| 7111 | 7125 | $entry = $usces->cart->get_entry(); |
| 7112 | 7126 | if ( empty( $entry ) ) { |
| 7113 | 7127 | $result_data = array( |
| 7114 | 7128 | 'action' => 'session', |
| @@ -7131,9 +7145,10 @@ | ||
| 7131 | 7145 | if ( $this->is_activate_card( 'api' ) && 1 === (int) $acting_opts['3dsecur'] ) { |
| 7132 | 7146 | $sendid = ( 'on' === $acting_opts['quickcharge'] && isset( $_POST['sendid'] ) ) ? filter_input( INPUT_POST, 'sendid' ) : ''; |
| 7133 | 7147 | $sendpoint = filter_input( INPUT_POST, 'sendpoint', FILTER_DEFAULT, array( 'options' => array( 'default' => '' ) ) ); |
| 7134 | 7148 | $_nonce = filter_input( INPUT_POST, '_nonce', FILTER_DEFAULT, array( 'options' => array( 'default' => wp_create_nonce( 'acting_zeus_card' ) ) ) ); |
| 7135 | - $uscesid = filter_input( INPUT_GET, 'uscesid', FILTER_DEFAULT, array( 'options' => array( 'default' => $usces->get_uscesid( false ) ) ) ); | |
| 7149 | + // A6: uscesid ブリッジ廃止。3DS 戻り(TermUrl)のセッションは sendpoint(取引キー)で | |
| 7150 | + // acting_processing() が usces_restore_order_acting_data() 復元するため uscesid は不要. | |
| 7136 | 7151 | |
| 7137 | 7152 | $data = array(); |
| 7138 | 7153 | $data['authentication']['clientip'] = $acting_opts['clientip']; |
| 7139 | 7154 | $data['authentication']['key'] = $acting_opts['authkey']; |
| @@ -7193,9 +7208,8 @@ | ||
| 7193 | 7208 | $term_data = array( |
| 7194 | 7209 | 'purchase' => '1', |
| 7195 | 7210 | 'sendpoint' => $sendpoint, |
| 7196 | 7211 | '_nonce' => $_nonce, |
| 7197 | - 'uscesid' => $uscesid, | |
| 7198 | 7212 | ); |
| 7199 | 7213 | $term_url = add_query_arg( $term_data, USCES_CART_URL ); |
| 7200 | 7214 | $result_data = array( |
| 7201 | 7215 | 'action' => 'EnrolReq', |
| @@ -7362,9 +7376,8 @@ | ||
| 7362 | 7376 | 'acting' => 'zeus_card', |
| 7363 | 7377 | 'acting_return' => 1, |
| 7364 | 7378 | 'result' => 1, |
| 7365 | 7379 | '_nonce' => $_nonce, |
| 7366 | - 'uscesid' => $usces->get_uscesid( false ), | |
| 7367 | 7380 | ), |
| 7368 | 7381 | USCES_CART_URL |
| 7369 | 7382 | ) |
| 7370 | 7383 | ); |