| @@ 1399-1415 (lines=17) @@ | ||
| 1396 | ||
| 1397 | //// |
|
| 1398 | // Parse and secure the cPath parameter values |
|
| 1399 | function tep_parse_category_path($cPath) { |
|
| 1400 | // make sure the category IDs are integers |
|
| 1401 | $cPath_array = array_map(function ($string) { |
|
| 1402 | return (int)$string; |
|
| 1403 | }, explode('_', $cPath)); |
|
| 1404 | ||
| 1405 | // make sure no duplicate category IDs exist which could lock the server in a loop |
|
| 1406 | $tmp_array = array(); |
|
| 1407 | $n = sizeof($cPath_array); |
|
| 1408 | for ($i=0; $i<$n; $i++) { |
|
| 1409 | if (!in_array($cPath_array[$i], $tmp_array)) { |
|
| 1410 | $tmp_array[] = $cPath_array[$i]; |
|
| 1411 | } |
|
| 1412 | } |
|
| 1413 | ||
| 1414 | return $tmp_array; |
|
| 1415 | } |
|
| 1416 | ||
| 1417 | //// |
|
| 1418 | // javascript to dynamically update the states/provinces list when the country is changed |
|
| @@ 1180-1196 (lines=17) @@ | ||
| 1177 | ||
| 1178 | //// |
|
| 1179 | // Parse and secure the cPath parameter values |
|
| 1180 | function tep_parse_category_path($cPath) { |
|
| 1181 | // make sure the category IDs are integers |
|
| 1182 | $cPath_array = array_map(function ($string) { |
|
| 1183 | return (int)$string; |
|
| 1184 | }, explode('_', $cPath)); |
|
| 1185 | ||
| 1186 | // make sure no duplicate category IDs exist which could lock the server in a loop |
|
| 1187 | $tmp_array = array(); |
|
| 1188 | $n = sizeof($cPath_array); |
|
| 1189 | for ($i=0; $i<$n; $i++) { |
|
| 1190 | if (!in_array($cPath_array[$i], $tmp_array)) { |
|
| 1191 | $tmp_array[] = $cPath_array[$i]; |
|
| 1192 | } |
|
| 1193 | } |
|
| 1194 | ||
| 1195 | return $tmp_array; |
|
| 1196 | } |
|
| 1197 | ||
| 1198 | function tep_count_customer_orders($id = '', $check_session = true) { |
|
| 1199 | $OSCOM_Db = Registry::get('Db'); |
|