  |
81 | 81 | | $products_id_string = tep_get_uprid($products_id, $attributes); |
| |
82 | 82 | | $products_id = tep_get_prid($products_id_string); |
| |
83 | 83 | | |
  |
84 | | - | if (is_numeric($products_id) && is_numeric($qty)) { |
| |
| 84 | + | $attributes_pass_check = true; |
| |
| 85 | + | |
| |
| 86 | + | if (is_array($attributes)) { |
| |
| 87 | + | reset($attributes); |
| |
| 88 | + | while (list($option, $value) = each($attributes)) { |
| |
| 89 | + | if (!is_numeric($option) || !is_numeric($value)) { |
| |
| 90 | + | $attributes_pass_check = false; |
| |
| 91 | + | break; |
| |
| 92 | + | } |
| |
| 93 | + | } |
| |
| 94 | + | } |
| |
| 95 | + | |
| |
| 96 | + | if (is_numeric($products_id) && is_numeric($qty) && ($attributes_pass_check == true)) { |
|
85 | 97 | | $check_product_query = tep_db_query("select products_status from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'"); |
| |
86 | 98 | | $check_product = tep_db_fetch_array($check_product_query); |
| |
87 | 99 | | |
| |
|
|
 |
… |
|
122 | 134 | | $products_id_string = tep_get_uprid($products_id, $attributes); |
| |
123 | 135 | | $products_id = tep_get_prid($products_id_string); |
| |
124 | 136 | | |
  |
125 | | - | if (is_numeric($products_id) && isset($this->contents[$products_id_string]) && is_numeric($quantity)) { |
| |
| 137 | + | $attributes_pass_check = true; |
| |
| 138 | + | |
| |
| 139 | + | if (is_array($attributes)) { |
| |
| 140 | + | reset($attributes); |
| |
| 141 | + | while (list($option, $value) = each($attributes)) { |
| |
| 142 | + | if (!is_numeric($option) || !is_numeric($value)) { |
| |
| 143 | + | $attributes_pass_check = false; |
| |
| 144 | + | break; |
| |
| 145 | + | } |
| |
| 146 | + | } |
| |
| 147 | + | } |
| |
| 148 | + | |
| |
| 149 | + | if (is_numeric($products_id) && isset($this->contents[$products_id_string]) && is_numeric($quantity) && ($attributes_pass_check == true)) { |
  |
126 | 150 | | $this->contents[$products_id_string] = array('qty' => $quantity); |
| |
127 | 151 | | // update database |
| |
128 | 152 | | if (tep_session_is_registered('customer_id')) tep_db_query("update " . TABLE_CUSTOMERS_BASKET . " set customers_basket_quantity = '" . (int)$quantity . "' where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products_id_string) . "'"); |