Changeset 2757214
- Timestamp:
- 07/16/2022 01:49:20 AM (4 years ago)
- Location:
- wpc-paypal-express-checkout
- Files:
-
- 2 added
- 4 edited
-
tags/1.2.1/includes/class-wpc-paypal-express-checkout-gateway.php (modified) (7 diffs)
-
tags/1.2.1/public/class-wpc-paypal-express-checkout-public.php (modified) (5 diffs)
-
tags/1.2.1/report.txt (added)
-
trunk/includes/class-wpc-paypal-express-checkout-gateway.php (modified) (7 diffs)
-
trunk/public/class-wpc-paypal-express-checkout-public.php (modified) (5 diffs)
-
trunk/report.txt (added)
Legend:
- Unmodified
- Added
- Removed
-
wpc-paypal-express-checkout/tags/1.2.1/includes/class-wpc-paypal-express-checkout-gateway.php
r2753956 r2757214 97 97 if (isset($this->response['TOKEN']) && !empty($this->response['TOKEN'])) { 98 98 wp_redirect($this->wpc_ec_payurl($this->response['TOKEN'])); 99 exit(); 100 99 101 } else { 100 102 if ($this->error_display_type == 'detailed') { … … 105 107 $this->is_order_completed = false; 106 108 wp_redirect($checkout_url); 109 exit(); 110 107 111 } 108 112 } catch (Exception $e) { 109 113 wc_add_notice(__('An error occurred, We were unable to process your order, please try again.', WPCPPEC_SLUG), 'error'); 110 114 wp_redirect($checkout_url); 115 exit(); 116 111 117 } 112 118 exit; … … 116 122 return; 117 123 } 118 $token = esc_attr($_GET['token']);124 $token = sanitize_text_field($_GET['token']); 119 125 try { 120 126 $this->response = $this->wpc_api()->wpc_ec_details($token); … … 205 211 } else { 206 212 wp_redirect(wc_get_checkout_url()); 213 exit(); 207 214 } 208 215 } catch (Exception $e) { 209 216 wc_add_notice(__('An error occurred, We were unable to process your order, please try again.', WPCPPEC_SLUG), 'error'); 210 217 wp_redirect($checkout_url); 218 exit(); 219 211 220 } 212 221 exit; … … 256 265 } 257 266 wp_redirect($checkout_url); 267 exit(); 268 258 269 } 259 270 return; … … 261 272 wc_add_notice(__('An error occurred, We were unable to process your order, please try again.', WPCPPEC_SLUG), 'error'); 262 273 wp_redirect($cancel_url); 274 exit(); 275 263 276 } 264 277 } … … 480 493 } else { 481 494 wp_redirect($args['redirect']); 495 exit(); 496 482 497 } 483 498 exit; -
wpc-paypal-express-checkout/tags/1.2.1/public/class-wpc-paypal-express-checkout-public.php
r2753956 r2757214 182 182 $btn_html = '<div id="wpc_btn_product" style="' . $display_style . '">' . $btn_html . '</div>'; 183 183 } 184 echo $btn_html;184 echo wp_kses_post($btn_html); 185 185 } 186 186 } … … 218 218 public function wpc_redirect_after_addto_cart($url) { 219 219 if (isset($_POST['wpc_btn_product']) && !empty($_POST['wpc_btn_product'])) { 220 return $_POST['wpc_btn_product'];220 return wp_kses_post($_POST['wpc_btn_product']); 221 221 } else { 222 222 return $url; … … 284 284 285 285 public function wc_ajax_update_shipping_costs() { 286 if (!wp_verify_nonce( $_POST['nonce'], '_wc_wpc_ec_update_shipping_costs_nonce')) {287 wp_die( __('Cheatin’ huh?', WPCPPEC_SLUG));286 if (!wp_verify_nonce(sanitize_text_field($_POST['nonce']), '_wc_wpc_ec_update_shipping_costs_nonce')) { 287 wp_die(esc_html('Cheatin’ huh?')); 288 288 } 289 289 if (!defined('WOOCOMMERCE_CART')) { … … 298 298 public function wpc_ajax_generate_cart() { 299 299 global $post; 300 if (!wp_verify_nonce( $_POST['nonce'], '_wpc_generate_cart_nonce')) {301 wp_die( __('Cheatin’ huh?', WPCPPEC_SLUG));300 if (!wp_verify_nonce(sanitize_text_field($_POST['nonce']), '_wpc_generate_cart_nonce')) { 301 wp_die(esc_html('Cheatin’ huh?')); 302 302 } 303 303 if (!defined('WOOCOMMERCE_CART')) { … … 312 312 $qty = !isset($_POST['qty']) ? 1 : absint($_POST['qty']); 313 313 if ($product->is_type('variable')) { 314 $attributes = array_map('wc_clean', $_POST['attributes']); 314 $attributes = array_map('wc_clean', $_POST['attributes']); // phpcs:ignore 315 315 if (version_compare(WC_VERSION, '3.0', '<')) { 316 316 $variation_id = $product->get_matching_variation($attributes); -
wpc-paypal-express-checkout/trunk/includes/class-wpc-paypal-express-checkout-gateway.php
r2080422 r2757214 97 97 if (isset($this->response['TOKEN']) && !empty($this->response['TOKEN'])) { 98 98 wp_redirect($this->wpc_ec_payurl($this->response['TOKEN'])); 99 exit(); 100 99 101 } else { 100 102 if ($this->error_display_type == 'detailed') { … … 105 107 $this->is_order_completed = false; 106 108 wp_redirect($checkout_url); 109 exit(); 110 107 111 } 108 112 } catch (Exception $e) { 109 113 wc_add_notice(__('An error occurred, We were unable to process your order, please try again.', WPCPPEC_SLUG), 'error'); 110 114 wp_redirect($checkout_url); 115 exit(); 116 111 117 } 112 118 exit; … … 116 122 return; 117 123 } 118 $token = esc_attr($_GET['token']);124 $token = sanitize_text_field($_GET['token']); 119 125 try { 120 126 $this->response = $this->wpc_api()->wpc_ec_details($token); … … 205 211 } else { 206 212 wp_redirect(wc_get_checkout_url()); 213 exit(); 207 214 } 208 215 } catch (Exception $e) { 209 216 wc_add_notice(__('An error occurred, We were unable to process your order, please try again.', WPCPPEC_SLUG), 'error'); 210 217 wp_redirect($checkout_url); 218 exit(); 219 211 220 } 212 221 exit; … … 256 265 } 257 266 wp_redirect($checkout_url); 267 exit(); 268 258 269 } 259 270 return; … … 261 272 wc_add_notice(__('An error occurred, We were unable to process your order, please try again.', WPCPPEC_SLUG), 'error'); 262 273 wp_redirect($cancel_url); 274 exit(); 275 263 276 } 264 277 } … … 480 493 } else { 481 494 wp_redirect($args['redirect']); 495 exit(); 496 482 497 } 483 498 exit; -
wpc-paypal-express-checkout/trunk/public/class-wpc-paypal-express-checkout-public.php
r2080422 r2757214 182 182 $btn_html = '<div id="wpc_btn_product" style="' . $display_style . '">' . $btn_html . '</div>'; 183 183 } 184 echo $btn_html;184 echo wp_kses_post($btn_html); 185 185 } 186 186 } … … 218 218 public function wpc_redirect_after_addto_cart($url) { 219 219 if (isset($_POST['wpc_btn_product']) && !empty($_POST['wpc_btn_product'])) { 220 return $_POST['wpc_btn_product'];220 return wp_kses_post($_POST['wpc_btn_product']); 221 221 } else { 222 222 return $url; … … 284 284 285 285 public function wc_ajax_update_shipping_costs() { 286 if (!wp_verify_nonce( $_POST['nonce'], '_wc_wpc_ec_update_shipping_costs_nonce')) {287 wp_die( __('Cheatin’ huh?', WPCPPEC_SLUG));286 if (!wp_verify_nonce(sanitize_text_field($_POST['nonce']), '_wc_wpc_ec_update_shipping_costs_nonce')) { 287 wp_die(esc_html('Cheatin’ huh?')); 288 288 } 289 289 if (!defined('WOOCOMMERCE_CART')) { … … 298 298 public function wpc_ajax_generate_cart() { 299 299 global $post; 300 if (!wp_verify_nonce( $_POST['nonce'], '_wpc_generate_cart_nonce')) {301 wp_die( __('Cheatin’ huh?', WPCPPEC_SLUG));300 if (!wp_verify_nonce(sanitize_text_field($_POST['nonce']), '_wpc_generate_cart_nonce')) { 301 wp_die(esc_html('Cheatin’ huh?')); 302 302 } 303 303 if (!defined('WOOCOMMERCE_CART')) { … … 312 312 $qty = !isset($_POST['qty']) ? 1 : absint($_POST['qty']); 313 313 if ($product->is_type('variable')) { 314 $attributes = array_map('wc_clean', $_POST['attributes']); 314 $attributes = array_map('wc_clean', $_POST['attributes']); // phpcs:ignore 315 315 if (version_compare(WC_VERSION, '3.0', '<')) { 316 316 $variation_id = $product->get_matching_variation($attributes);
Note: See TracChangeset
for help on using the changeset viewer.