From 351420085eebe8f9b7d4341d502d74c4b8e8ada5 Mon Sep 17 00:00:00 2001 From: Saiful Islam Date: Thu, 3 Jun 2021 00:40:36 +0600 Subject: [PATCH] stable tag update and $_REQUEST direct calling issue fixed --- includes/helper-functions.php | 11 +++++------ readme.txt | 2 +- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/includes/helper-functions.php b/includes/helper-functions.php index 0ec34090..fd36c46b 100644 --- a/includes/helper-functions.php +++ b/includes/helper-functions.php @@ -558,11 +558,10 @@ function wpt_add_custom_message_field() { * @return boolean */ function wpt_custom_message_validation() { - $req = isset( $_REQUEST ) && ! empty( $_REQUEST ) ? $_REQUEST : array(); - if ( empty( $req['wpt_custom_message'] ) ) { + if ( isset( $_REQUEST['wpt_custom_message'] ) && empty( $_REQUEST['wpt_custom_message'] ) ) { $short_mesg_warning = __( 'Please enter Short Message', 'wpt_pro' ); - $short_mesg_warning = apply_filters( 'wpto_short_message_warning', $short_mesg_warning, $req ); + $short_mesg_warning = apply_filters( 'wpto_short_message_warning', $short_mesg_warning ); wc_add_notice( $short_mesg_warning, 'error' ); return false; } @@ -580,9 +579,9 @@ function wpt_custom_message_validation() { * @return string */ function wpt_save_custom_message_field( $cart_item_data, $product_id ) { - $req = isset( $_REQUEST ) && ! empty( $_REQUEST ) ? $_REQUEST : array(); - if( isset( $req['wpt_custom_message'] ) ) { - $generated_message = esc_html( $req['wpt_custom_message'] ); + + if( isset( $_REQUEST['wpt_custom_message'] ) ) { + $generated_message = esc_html( $_REQUEST['wpt_custom_message'] ); $cart_item_data[ 'wpt_custom_message' ] = $generated_message; //XSS ok /* below statement make sure every add to cart action as unique line item */ $cart_item_data['unique_key'] = $product_id . '_' . $generated_message;//md5( microtime().rand() ); diff --git a/readme.txt b/readme.txt index 8c86187b..dc6f4843 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Donate link: https://codecanyon.net/item/woo-product-table-pro/20676867?ref=Code Tags: wc product table,woocommerce product table, product table, wc table, quick order table, wholesale table, restaurants table Requires at least: 4.0.0 Tested up to: 5.7.2 -Stable tag: 2.9.0 +Stable tag: 2.9.1 Requires PHP: 5.6 License: GPLv2 or later License URI: https://www.gnu.org/licenses/gpl-2.0.html