Skip to content

Commit

Permalink
stable tag update and $_REQUEST direct calling issue fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
codersaiful committed Jun 2, 2021
1 parent b811a79 commit 3514200
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
11 changes: 5 additions & 6 deletions includes/helper-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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() );
Expand Down
2 changes: 1 addition & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3514200

Please sign in to comment.