Skip to content

Commit

Permalink
ajax_add_to_cart.php to helper-functions.php file - Name change of a …
Browse files Browse the repository at this point in the history
…file AND REQUEST warning solved
  • Loading branch information
codersaiful committed Jun 2, 2021
1 parent da71c38 commit da718c2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,8 @@ function wpt_add_custom_message_field() {
* @return boolean
*/
function wpt_custom_message_validation() {
$req = filter_input_array( INPUT_REQUEST );
$req = isset( $_REQUEST ) && ! empty( $_REQUEST ) ? $_REQUEST : array();

if ( empty( $req['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 );
Expand All @@ -579,7 +580,7 @@ function wpt_custom_message_validation() {
* @return string
*/
function wpt_save_custom_message_field( $cart_item_data, $product_id ) {
$req = filter_input_array( INPUT_REQUEST );
$req = isset( $_REQUEST ) && ! empty( $_REQUEST ) ? $_REQUEST : array();
if( isset( $req['wpt_custom_message'] ) ) {
$generated_message = esc_html( $req['wpt_custom_message'] );
$cart_item_data[ 'wpt_custom_message' ] = $generated_message; //XSS ok
Expand Down
2 changes: 1 addition & 1 deletion woo-product-table.php
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ public function __construct() {
//include_once $this->path('BASE_DIR','includes/wpt_product_table_post.php');
include_once $this->path('BASE_DIR','includes/enqueue.php');
include_once $this->path('BASE_DIR','includes/functions.php');
include_once $this->path('BASE_DIR','includes/ajax_add_to_cart.php');
include_once $this->path('BASE_DIR','includes/helper-functions.php');
include_once $this->path('BASE_DIR','includes/shortcode.php');

}
Expand Down

0 comments on commit da718c2

Please sign in to comment.