Changeset 3075889
- Timestamp:
- 04/23/2024 03:07:10 PM (2 years ago)
- Location:
- posti-warehouse
- Files:
-
- 8 edited
- 1 copied
-
tags/2.5.1 (copied) (copied from posti-warehouse/trunk)
-
tags/2.5.1/README.md (modified) (1 diff)
-
tags/2.5.1/classes/class-api.php (modified) (1 diff)
-
tags/2.5.1/classes/class-frontend.php (modified) (3 diffs)
-
tags/2.5.1/posti-warehouse.php (modified) (1 diff)
-
trunk/README.md (modified) (1 diff)
-
trunk/classes/class-api.php (modified) (1 diff)
-
trunk/classes/class-frontend.php (modified) (3 diffs)
-
trunk/posti-warehouse.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
posti-warehouse/tags/2.5.1/README.md
r3044915 r3075889 97 97 98 98 ## Version history 99 - 2.5.1: Removed unnecessary nonce checks to fix "Checkout nonce failed to verify" when order is submitted by guest with "Create an account" enabled. 99 100 - 2.5.0: 100 101 - Changed "Hide outdoor pickup points" option to support non-Posti pickup points. -
posti-warehouse/tags/2.5.1/classes/class-api.php
r3044915 r3075889 14 14 private $last_status = false; 15 15 private $token_option = 'posti_wh_api_auth'; 16 private $user_agent = 'woo-wh-client/2.5. 0';16 private $user_agent = 'woo-wh-client/2.5.1'; 17 17 18 18 public function __construct(Posti_Warehouse_Logger $logger, array &$options) { -
posti-warehouse/tags/2.5.1/classes/class-frontend.php
r3044915 r3075889 172 172 */ 173 173 public function update_order_meta_pickup_point_field( $order_id) { 174 $logger = wc_get_logger(); 175 if (!isset($_POST['woocommerce-process-checkout-nonce']) 176 || !wp_verify_nonce(sanitize_key($_POST['woocommerce-process-checkout-nonce']), 'woocommerce-process_checkout')) { 177 $logger->error('Failed to verify update_order_meta_pickup_point_field nonce'); 178 throw new \Exception('Failed to verify update_order_meta_pickup_point_field nonce'); 179 } 174 // NOTE: nonce verification is not needed here and will fail when guest submits order with "Create an account?" 175 // https://github.com/woocommerce/woocommerce/issues/44779 180 176 181 177 $key = $this->add_prefix('_pickup_point'); … … 578 574 579 575 public function validate_checkout() { 580 $logger = wc_get_logger();581 if (!isset($_POST['woocommerce-process-checkout-nonce'])582 || !wp_verify_nonce(sanitize_key($_POST['woocommerce-process-checkout-nonce']), 'woocommerce-process_checkout')) {583 $logger->error('Checkout nonce failed to verify');584 throw new \Exception('Checkout nonce failed to verify');585 }586 587 576 $key = $this->add_prefix('_pickup_point'); 588 577 $pickup_data = isset($_POST[$key]) ? sanitize_text_field($_POST[$key]) : '__NULL__'; … … 606 595 607 596 public function add_metadata_to_order_shipping_method( $item, $package_key, $package, $order) { 608 $logger = wc_get_logger();609 if (!isset($_POST['woocommerce-process-checkout-nonce'])610 || !wp_verify_nonce(sanitize_key($_POST['woocommerce-process-checkout-nonce']), 'woocommerce-process_checkout')) {611 $logger->error('Checkout nonce failed to verify');612 throw new \Exception('Checkout nonce failed to verify');613 }614 615 597 if (isset($_POST['warehouse_pickup_point'])) { 616 598 $item->update_meta_data($this->add_prefix('_pickup_point'), sanitize_text_field($_POST['warehouse_pickup_point'])); -
posti-warehouse/tags/2.5.1/posti-warehouse.php
r3044915 r3075889 3 3 /** 4 4 * Plugin Name: Posti Warehouse 5 * Version: 2.5. 05 * Version: 2.5.1 6 6 * Description: Provides integration to Posti warehouse and dropshipping services. 7 7 * Author: Posti -
posti-warehouse/trunk/README.md
r3044915 r3075889 97 97 98 98 ## Version history 99 - 2.5.1: Removed unnecessary nonce checks to fix "Checkout nonce failed to verify" when order is submitted by guest with "Create an account" enabled. 99 100 - 2.5.0: 100 101 - Changed "Hide outdoor pickup points" option to support non-Posti pickup points. -
posti-warehouse/trunk/classes/class-api.php
r3044915 r3075889 14 14 private $last_status = false; 15 15 private $token_option = 'posti_wh_api_auth'; 16 private $user_agent = 'woo-wh-client/2.5. 0';16 private $user_agent = 'woo-wh-client/2.5.1'; 17 17 18 18 public function __construct(Posti_Warehouse_Logger $logger, array &$options) { -
posti-warehouse/trunk/classes/class-frontend.php
r3044915 r3075889 172 172 */ 173 173 public function update_order_meta_pickup_point_field( $order_id) { 174 $logger = wc_get_logger(); 175 if (!isset($_POST['woocommerce-process-checkout-nonce']) 176 || !wp_verify_nonce(sanitize_key($_POST['woocommerce-process-checkout-nonce']), 'woocommerce-process_checkout')) { 177 $logger->error('Failed to verify update_order_meta_pickup_point_field nonce'); 178 throw new \Exception('Failed to verify update_order_meta_pickup_point_field nonce'); 179 } 174 // NOTE: nonce verification is not needed here and will fail when guest submits order with "Create an account?" 175 // https://github.com/woocommerce/woocommerce/issues/44779 180 176 181 177 $key = $this->add_prefix('_pickup_point'); … … 578 574 579 575 public function validate_checkout() { 580 $logger = wc_get_logger();581 if (!isset($_POST['woocommerce-process-checkout-nonce'])582 || !wp_verify_nonce(sanitize_key($_POST['woocommerce-process-checkout-nonce']), 'woocommerce-process_checkout')) {583 $logger->error('Checkout nonce failed to verify');584 throw new \Exception('Checkout nonce failed to verify');585 }586 587 576 $key = $this->add_prefix('_pickup_point'); 588 577 $pickup_data = isset($_POST[$key]) ? sanitize_text_field($_POST[$key]) : '__NULL__'; … … 606 595 607 596 public function add_metadata_to_order_shipping_method( $item, $package_key, $package, $order) { 608 $logger = wc_get_logger();609 if (!isset($_POST['woocommerce-process-checkout-nonce'])610 || !wp_verify_nonce(sanitize_key($_POST['woocommerce-process-checkout-nonce']), 'woocommerce-process_checkout')) {611 $logger->error('Checkout nonce failed to verify');612 throw new \Exception('Checkout nonce failed to verify');613 }614 615 597 if (isset($_POST['warehouse_pickup_point'])) { 616 598 $item->update_meta_data($this->add_prefix('_pickup_point'), sanitize_text_field($_POST['warehouse_pickup_point'])); -
posti-warehouse/trunk/posti-warehouse.php
r3044915 r3075889 3 3 /** 4 4 * Plugin Name: Posti Warehouse 5 * Version: 2.5. 05 * Version: 2.5.1 6 6 * Description: Provides integration to Posti warehouse and dropshipping services. 7 7 * Author: Posti
Note: See TracChangeset
for help on using the changeset viewer.