Skip to content

Instantly share code, notes, and snippets.

@rameshelamathi
Last active February 20, 2019 12:16
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/6731ad8d2ec4be8d37d1195ae7d972e3 to your computer and use it in GitHub Desktop.
Save rameshelamathi/6731ad8d2ec4be8d37d1195ae7d972e3 to your computer and use it in GitHub Desktop.
IMPORTANT: SQL Injection fix for J2Store 3.3.2 and lower
//SQL Injection fix for J2Store 3.3.2 and lower
//File path: /administrator/components/com_j2store/helpers/product.php
//around line number 1137, you will find
if(empty($option_value)) return $ovsets;
//Change this to
if(empty($option_value)) return $ovsets;
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