Skip to content

Instantly share code, notes, and snippets.

@rameshelamathi
Last active February 20, 2019 12:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rameshelamathi/bf34b537fdca5cd5e96cc94d1c116687 to your computer and use it in GitHub Desktop.
Save rameshelamathi/bf34b537fdca5cd5e96cc94d1c116687 to your computer and use it in GitHub Desktop.
IMPORTANT: SQL Injection fix for J2Store 3.3.3 to 3.3.6
//SQL Injection fix for J2Store 3.3.3 to 3.3.6
//File path: /administrator/components/com_j2store/helpers/product.php
//around line number 1139, you will find
if(is_array($option_value)){
$option_value = implode(',',$option_value);
}
//Change this to
if(is_array($option_value)){
JArrayHelper::toInteger($option_value);
$option_value = implode(',',$option_value);
}else {
$option_value = intval($option_value);
}
//Save
//Around line 1149, you will find
$query->where('pov.j2store_product_optionvalue_id='.$option_value);
$query->where('pov.productoption_id='.$product_option_id);
//Change this to
$query->where('pov.j2store_product_optionvalue_id='.$db->q($option_value));
$query->where('pov.productoption_id='.$db->q($product_option_id));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment