Below is a differential between the unpatched vulnerable code and the patched update, for reference.
--- a/usc-e-shop/classes/cart.class.php
+++ b/usc-e-shop/classes/cart.class.php
@@ -151,12 +151,12 @@
$_SESSION['usces_cart'][ $this->serial ]['quant'] = (int) $_POST['quant'][ $index ][ $post_id ][ $sku ];
$_SESSION['usces_cart'][ $this->serial ]['advance'] = isset( $_POST['advance'][ $index ][ $post_id ][ $sku ] ) ? $_POST['advance'][ $index ][ $post_id ][ $sku ] : array();
- if ( isset( $_POST['order_action'] ) ) {
- $price = (int) $_POST['skuPrice'][ $index ][ $post_id ][ $sku ];
- } else {
+ // if ( isset( $_POST['order_action'] ) ) {
+ // $price = (int) $_POST['skuPrice'][ $index ][ $post_id ][ $sku ];
+ // } else {
$price = $this->get_realprice( $post_id, $sku, $_SESSION['usces_cart'][ $this->serial ]['quant'] );
$price = apply_filters( 'usces_filter_upCart_price', $price, $this->serial, $index );
- }
+ // }
$_SESSION['usces_cart'][ $this->serial ]['price'] = $price;
}
--- a/usc-e-shop/classes/paymentPayPalCP.class.php
+++ b/usc-e-shop/classes/paymentPayPalCP.class.php
@@ -4231,6 +4231,43 @@
} else {
$pending = false;
$amount = $this->get_latest_amount( $order_id, $tracking_id );
+
+ $latest_log = $this->get_acting_latest_log( $order_id, $tracking_id, 'ALL' );
+ if ( isset( $latest_log['result'] ) && 'COMPLETED' !== $latest_log['result'] && 'PENDING' !== $latest_log['result'] ) {
+ $acting_status = $this->get_acting_status( $order_id, $tracking_id );
+ $class = ' paypal-' . strtolower( $acting_status );
+ $result .= '<div class="paypal-settlement-admin' . $class . '">' . __( $acting_status, 'usces' ) . '</div>';
+ $log = $this->get_entry_log( $tracking_id );
+ if ( isset( $log['entry'] ) && isset( $log['cart'] ) ) {
+ $result .= '<table class="paypal-settlement-admin-table">
+ <tr><th>' . __( 'Transaction amount', 'usces' ) . '</th>
+ <td><input type="tel" class="settlement-amount" value="' . usces_crform( $amount, false, false, 'return', true ) . '" readonly />' . __( usces_crcode( 'return' ), 'usces' ) . '</td>
+ </tr>';
+ if ( empty( $amount ) ) {
+ if ( defined( 'WCEX_DLSELLER' ) && ! empty( $con_id ) ) {
+ $amount = $this->get_continuation_amount( $con_id );
+ } elseif ( defined( 'WCEX_AUTO_DELIVERY' ) && ! empty( $reg_id ) ) {
+ $amount = $this->get_order_amount( $order_id );
+ }
+ }
+ $result .= '
+ <tr><th>' . __( 'Settlement amount', 'usces' ) . '</th>
+ <td><input type="tel" class="settlement-amount amount" id="amount_resettlement" value="' . usces_crform( $amount, false, false, 'return', false ) . '" />' . __( usces_crcode( 'return' ), 'usces' ) . '</td>
+ </tr>
+ </table>';
+ if ( 'paypal_cp' === $acting ) {
+ $result .= '<div class="paypal-settlement-admin-button">
+ <input id="re-authorize-settlement" type="button" class="button" value="' . __( 'AUTHORIZE', 'usces' ) . '" />
+ <input id="re-capture-settlement" type="button" class="button" value="' . __( 'CAPTURE', 'usces' ) . '" />
+ </div>';
+ }
+ }
+ $result .= $this->settlement_history( $order_id, $tracking_id );
+ $data['result'] = $result;
+ wp_send_json( $data );
+ break;
+ }
+
if ( isset( $response_data['intent'] ) && isset( $response_data['purchase_units'] ) ) {
$acting_status = $response_data['intent'];
$purchase_units = $response_data['purchase_units'][0];
@@ -6996,15 +7033,19 @@
</thead>
<tbody class="settlement-history-body">';
foreach ( (array) $log_data as $data ) {
+ $log = usces_unserialize( $data['log'] );
+ $id = ( isset( $log['id'] ) ) ? $log['id'] : '';
+ $issue = '';
if ( 'COMPLETED' !== $data['result'] ) {
$class = ' error';
$amount = '';
+ if ( isset( $log['details'][0]['issue'] ) && '' !== $log['details'][0]['issue'] ) {
+ $issue = ' (' . $log['details'][0]['issue'] . ')';
+ }
} else {
$class = '';
$amount = ( isset( $data['amount'] ) ) ? usces_crform( $data['amount'], false, true, 'return', true ) : '';
}
- $log = usces_unserialize( $data['log'] );
- $id = ( isset( $log['id'] ) ) ? $log['id'] : '';
if ( isset( $log['purchase_units'] ) ) {
$purchase_units = $log['purchase_units'][0];
if ( isset( $purchase_units['payments'] ) ) {
@@ -7026,7 +7067,7 @@
<td class="transactionid">' . $id . '</td>
<td class="status">' . $data['status'] . '</td>
<td class="amount">' . $amount . '</td>
- <td class="result' . $class . '">' . $data['result'] . '</td>
+ <td class="result' . $class . '">' . $data['result'] . $issue . '</td>
</tr>';
$num--;
}
--- a/usc-e-shop/classes/usceshop.class.php
+++ b/usc-e-shop/classes/usceshop.class.php
@@ -5115,7 +5115,7 @@
if ( is_array( $_SESSION['usces_member'][ $key ] ) ) {
$res[ $key ] = stripslashes_deep( $value );
} else {
- $res[ $key ] = stripslashes( $value );
+ $res[ $key ] = null !== $value ? stripslashes( $value ) : '';
}
}
}
--- a/usc-e-shop/functions/function.php
+++ b/usc-e-shop/functions/function.php
@@ -1830,10 +1830,15 @@
case 'paypal':
usces_log( 'paypal in ', 'acting_transaction.log' );
- require_once( $usces->options['settlement_path'] . 'paypal.php' );
- $results = paypal_check( $usces_paypal_url );
- remove_action( 'shutdown', array( &$usces, 'lastprocessing' ) );
- $results['reg_order'] = true;
+ $paypal_file = $usces->options['settlement_path'] . 'paypal.php';
+ if ( file_exists( $paypal_file ) ) {
+ require_once( $paypal_file );
+ $results = paypal_check( $usces_paypal_url );
+ remove_action( 'shutdown', array( &$usces, 'lastprocessing' ) );
+ $results['reg_order'] = true;
+ } else {
+ $results['reg_order'] = true;
+ }
break;
case 'remise_card':
@@ -3865,6 +3870,35 @@
case 2: //Text.
$html .= "n<input name='itemOption[{$post_id}][{$sku}][{$optcode}]' type='text' id='itemOption[{$post_id}][{$sku}][{$optcode}]' class='iopt_text' onKeyDown="if (event.keyCode == 13) {return false;}" value="" . esc_attr( $session_value ) . "" />n";
break;
+ case 3: //Radio-button.
+ $selects = explode( "n", $opt['value'] );
+ $i = 0;
+ foreach ( (array) $selects as $v ) {
+ $v = trim( $v );
+ if ( $v === $session_value ) {
+ $checked = ' checked="checked"';
+ } else {
+ $checked = '';
+ }
+ $html .= "t<label for='itemOption[{$post_id}][{$sku}][{$optcode}]{$i}' class='iopt_radio_label'><input name='itemOption[{$post_id}][{$sku}][{$optcode}]' id='itemOption[{$post_id}][{$sku}][{$optcode}]{$i}' class='iopt_radio' type='radio' value='" . urlencode( $v ) . "'{$checked} onKeyDown="if (event.keyCode == 13) {return false;}">" . esc_html( $v ) . "</label>n";
+ $i++;
+ }
+ break;
+ case 4: //Check-box.
+ $selects = explode( "n", $opt['value'] );
+ $session_arr = is_array( $session_value ) ? $session_value : array();
+ $i = 0;
+ foreach ( (array) $selects as $v ) {
+ $v = trim( $v );
+ if ( in_array( $v, $session_arr, true ) ) {
+ $checked = ' checked="checked"';
+ } else {
+ $checked = '';
+ }
+ $html .= "t<label for='itemOption[{$post_id}][{$sku}][{$optcode}]{$i}' class='iopt_checkbox_label'><input name='itemOption[{$post_id}][{$sku}][{$optcode}][]' id='itemOption[{$post_id}][{$sku}][{$optcode}]{$i}' class='iopt_checkbox' type='checkbox' value='" . urlencode( $v ) . "'{$checked} onKeyDown="if (event.keyCode == 13) {return false;}">" . esc_html( $v ) . "</label>n";
+ $i++;
+ }
+ break;
case 5: //Text-area.
$html .= "n<textarea name='itemOption[{$post_id}][{$sku}][{$optcode}]' id='itemOption[{$post_id}][{$sku}][{$optcode}]' class='iopt_textarea'>" . esc_attr( $session_value ) . "</textarea>n";
break;
--- a/usc-e-shop/usc-e-shop.php
+++ b/usc-e-shop/usc-e-shop.php
@@ -3,7 +3,7 @@
* Plugin Name: Welcart e-Commerce
* Plugin URI: https://www.welcart.com/
* Description: Welcart builds the management system with a net shop on WordPress.
- * Version: 2.11.28
+ * Version: 2.11.29
* Author: Welcart Inc.
* Author URI: https://www.welcart.com/
* License: GPLv2 or later
@@ -16,7 +16,7 @@
* @package Welcart
*/
-define( 'USCES_VERSION', '2.11.28.2604011' );
+define( 'USCES_VERSION', '2.11.29.2606031' );
define( 'USCES_DB_ACCESS', '1.5' );
define( 'USCES_DB_MEMBER', '1.1' );
define( 'USCES_DB_MEMBER_META', '1.1' );