Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Removing deprecated HTTP_XXX_VARS and precount sizeof for performance…

… improvement
  • Loading branch information...
commit 3ec67abe5c0883fd260fd643746c13947fb0d27a 1 parent c2d94f6
@acidvertigo acidvertigo authored
View
2  catalog/account_history.php
@@ -57,7 +57,7 @@
<tr>
<td width="50%" valign="top"><?php echo '<strong>' . TEXT_ORDER_DATE . '</strong> ' . tep_date_long($history['date_purchased']) . '<br /><strong>' . $order_type . '</strong> ' . tep_output_string_protected($order_name); ?></td>
<td width="30%" valign="top"><?php echo '<strong>' . TEXT_ORDER_PRODUCTS . '</strong> ' . $products['count'] . '<br /><strong>' . TEXT_ORDER_COST . '</strong> ' . strip_tags($history['order_total']); ?></td>
- <td width="20%" align="right"><?php echo tep_draw_button(SMALL_IMAGE_BUTTON_VIEW, 'document', tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, (isset($HTTP_GET_VARS['page']) ? 'page=' . $HTTP_GET_VARS['page'] . '&' : '') . 'order_id=' . $history['orders_id'], 'SSL'), 'primary'); ?></td>
+ <td width="20%" align="right"><?php echo tep_draw_button(SMALL_IMAGE_BUTTON_VIEW, 'document', tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, (isset($_GET['page']) ? 'page=' . $_GET['page'] . '&' : '') . 'order_id=' . $history['orders_id'], 'SSL'), 'primary'); ?></td>
</tr>
</table>
</div>
View
6 catalog/account_newsletters.php
@@ -23,9 +23,9 @@
$newsletter_query = tep_db_query("select customers_newsletter from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$customer_id . "'");
$newsletter = tep_db_fetch_array($newsletter_query);
- if (isset($HTTP_POST_VARS['action']) && ($HTTP_POST_VARS['action'] == 'process') && isset($HTTP_POST_VARS['formid']) && ($HTTP_POST_VARS['formid'] == $sessiontoken)) {
- if (isset($HTTP_POST_VARS['newsletter_general']) && is_numeric($HTTP_POST_VARS['newsletter_general'])) {
- $newsletter_general = tep_db_prepare_input($HTTP_POST_VARS['newsletter_general']);
+ if (isset($_POST['action']) && ($_POST['action'] == 'process') && isset($_POST['formid']) && ($_POST['formid'] == $sessiontoken)) {
+ if (isset($_POST['newsletter_general']) && is_numeric($_POST['newsletter_general'])) {
+ $newsletter_general = tep_db_prepare_input($_POST['newsletter_general']);
} else {
$newsletter_general = '0';
}
View
11 catalog/account_notifications.php
@@ -23,14 +23,14 @@
$global_query = tep_db_query("select global_product_notifications from " . TABLE_CUSTOMERS_INFO . " where customers_info_id = '" . (int)$customer_id . "'");
$global = tep_db_fetch_array($global_query);
- if (isset($HTTP_POST_VARS['action']) && ($HTTP_POST_VARS['action'] == 'process') && isset($HTTP_POST_VARS['formid']) && ($HTTP_POST_VARS['formid'] == $sessiontoken)) {
- if (isset($HTTP_POST_VARS['product_global']) && is_numeric($HTTP_POST_VARS['product_global'])) {
- $product_global = tep_db_prepare_input($HTTP_POST_VARS['product_global']);
+ if (isset($_POST['action']) && ($_POST['action'] == 'process') && isset($_POST['formid']) && ($_POST['formid'] == $sessiontoken)) {
+ if (isset($_POST['product_global']) && is_numeric($_POST['product_global'])) {
+ $product_global = tep_db_prepare_input($_POST['product_global']);
} else {
$product_global = '0';
}
- (array)$products = $HTTP_POST_VARS['products'];
+ (array)$products = $_POST['products'];
if ($product_global != $global['global_product_notifications']) {
$product_global = (($global['global_product_notifications'] == '1') ? '0' : '1');
@@ -38,8 +38,7 @@
tep_db_query("update " . TABLE_CUSTOMERS_INFO . " set global_product_notifications = '" . (int)$product_global . "' where customers_info_id = '" . (int)$customer_id . "'");
} elseif (sizeof($products) > 0) {
$products_parsed = array();
- reset($products);
- while (list(, $value) = each($products)) {
+ foreach ($products as $value) {
if (is_numeric($value)) {
$products_parsed[] = $value;
}
View
86 catalog/address_book_process.php
@@ -20,11 +20,11 @@
// needs to be included earlier to set the success message in the messageStack
require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_ADDRESS_BOOK_PROCESS);
- if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'deleteconfirm') && isset($HTTP_GET_VARS['delete']) && is_numeric($HTTP_GET_VARS['delete']) && isset($HTTP_GET_VARS['formid']) && ($HTTP_GET_VARS['formid'] == md5($sessiontoken))) {
- if ((int)$HTTP_GET_VARS['delete'] == $customer_default_address_id) {
+ if (isset($_GET['action']) && ($_GET['action'] == 'deleteconfirm') && isset($_GET['delete']) && is_numeric($_GET['delete']) && isset($_GET['formid']) && ($_GET['formid'] == md5($sessiontoken))) {
+ if ((int)$_GET['delete'] == $customer_default_address_id) {
$messageStack->add_session('addressbook', WARNING_PRIMARY_ADDRESS_DELETION, 'warning');
} else {
- tep_db_query("delete from " . TABLE_ADDRESS_BOOK . " where address_book_id = '" . (int)$HTTP_GET_VARS['delete'] . "' and customers_id = '" . (int)$customer_id . "'");
+ tep_db_query("delete from " . TABLE_ADDRESS_BOOK . " where address_book_id = '" . (int)$_GET['delete'] . "' and customers_id = '" . (int)$customer_id . "'");
$messageStack->add_session('addressbook', SUCCESS_ADDRESS_BOOK_ENTRY_DELETED, 'success');
}
@@ -34,26 +34,26 @@
// error checking when updating or adding an entry
$process = false;
- if (isset($HTTP_POST_VARS['action']) && (($HTTP_POST_VARS['action'] == 'process') || ($HTTP_POST_VARS['action'] == 'update')) && isset($HTTP_POST_VARS['formid']) && ($HTTP_POST_VARS['formid'] == $sessiontoken)) {
+ if (isset($_POST['action']) && (($_POST['action'] == 'process') || ($_POST['action'] == 'update')) && isset($_POST['formid']) && ($_POST['formid'] == $sessiontoken)) {
$process = true;
$error = false;
- if (ACCOUNT_GENDER == 'true') $gender = tep_db_prepare_input($HTTP_POST_VARS['gender']);
- if (ACCOUNT_COMPANY == 'true') $company = tep_db_prepare_input($HTTP_POST_VARS['company']);
- $firstname = tep_db_prepare_input($HTTP_POST_VARS['firstname']);
- $lastname = tep_db_prepare_input($HTTP_POST_VARS['lastname']);
- $street_address = tep_db_prepare_input($HTTP_POST_VARS['street_address']);
- if (ACCOUNT_SUBURB == 'true') $suburb = tep_db_prepare_input($HTTP_POST_VARS['suburb']);
- $postcode = tep_db_prepare_input($HTTP_POST_VARS['postcode']);
- $city = tep_db_prepare_input($HTTP_POST_VARS['city']);
- $country = tep_db_prepare_input($HTTP_POST_VARS['country']);
+ if (ACCOUNT_GENDER == 'true') $gender = tep_db_prepare_input($_POST['gender']);
+ if (ACCOUNT_COMPANY == 'true') $company = tep_db_prepare_input($_POST['company']);
+ $firstname = tep_db_prepare_input($_POST['firstname']);
+ $lastname = tep_db_prepare_input($_POST['lastname']);
+ $street_address = tep_db_prepare_input($_POST['street_address']);
+ if (ACCOUNT_SUBURB == 'true') $suburb = tep_db_prepare_input($_POST['suburb']);
+ $postcode = tep_db_prepare_input($_POST['postcode']);
+ $city = tep_db_prepare_input($_POST['city']);
+ $country = tep_db_prepare_input($_POST['country']);
if (ACCOUNT_STATE == 'true') {
- if (isset($HTTP_POST_VARS['zone_id'])) {
- $zone_id = tep_db_prepare_input($HTTP_POST_VARS['zone_id']);
+ if (isset($_POST['zone_id'])) {
+ $zone_id = tep_db_prepare_input($_POST['zone_id']);
} else {
$zone_id = false;
}
- $state = tep_db_prepare_input($HTTP_POST_VARS['state']);
+ $state = tep_db_prepare_input($_POST['state']);
}
if (ACCOUNT_GENDER == 'true') {
@@ -145,21 +145,21 @@
}
}
- if ($HTTP_POST_VARS['action'] == 'update') {
- $check_query = tep_db_query("select address_book_id from " . TABLE_ADDRESS_BOOK . " where address_book_id = '" . (int)$HTTP_GET_VARS['edit'] . "' and customers_id = '" . (int)$customer_id . "' limit 1");
+ if ($_POST['action'] == 'update') {
+ $check_query = tep_db_query("select address_book_id from " . TABLE_ADDRESS_BOOK . " where address_book_id = '" . (int)$_GET['edit'] . "' and customers_id = '" . (int)$customer_id . "' limit 1");
if (tep_db_num_rows($check_query) == 1) {
- tep_db_perform(TABLE_ADDRESS_BOOK, $sql_data_array, 'update', "address_book_id = '" . (int)$HTTP_GET_VARS['edit'] . "' and customers_id ='" . (int)$customer_id . "'");
+ tep_db_perform(TABLE_ADDRESS_BOOK, $sql_data_array, 'update', "address_book_id = '" . (int)$_GET['edit'] . "' and customers_id ='" . (int)$customer_id . "'");
// reregister session variables
- if ( (isset($HTTP_POST_VARS['primary']) && ($HTTP_POST_VARS['primary'] == 'on')) || ($HTTP_GET_VARS['edit'] == $customer_default_address_id) ) {
+ if ( (isset($_POST['primary']) && ($_POST['primary'] == 'on')) || ($_GET['edit'] == $customer_default_address_id) ) {
$customer_first_name = $firstname;
$customer_country_id = $country;
$customer_zone_id = (($zone_id > 0) ? (int)$zone_id : '0');
- $customer_default_address_id = (int)$HTTP_GET_VARS['edit'];
+ $customer_default_address_id = (int)$_GET['edit'];
$sql_data_array = array('customers_firstname' => $firstname,
'customers_lastname' => $lastname,
- 'customers_default_address_id' => (int)$HTTP_GET_VARS['edit']);
+ 'customers_default_address_id' => (int)$_GET['edit']);
if (ACCOUNT_GENDER == 'true') $sql_data_array['customers_gender'] = $gender;
@@ -176,17 +176,17 @@
$new_address_book_id = tep_db_insert_id();
// reregister session variables
- if (isset($HTTP_POST_VARS['primary']) && ($HTTP_POST_VARS['primary'] == 'on')) {
+ if (isset($_POST['primary']) && ($_POST['primary'] == 'on')) {
$customer_first_name = $firstname;
$customer_country_id = $country;
$customer_zone_id = (($zone_id > 0) ? (int)$zone_id : '0');
- if (isset($HTTP_POST_VARS['primary']) && ($HTTP_POST_VARS['primary'] == 'on')) $customer_default_address_id = $new_address_book_id;
+ if (isset($_POST['primary']) && ($_POST['primary'] == 'on')) $customer_default_address_id = $new_address_book_id;
$sql_data_array = array('customers_firstname' => $firstname,
'customers_lastname' => $lastname);
if (ACCOUNT_GENDER == 'true') $sql_data_array['customers_gender'] = $gender;
- if (isset($HTTP_POST_VARS['primary']) && ($HTTP_POST_VARS['primary'] == 'on')) $sql_data_array['customers_default_address_id'] = $new_address_book_id;
+ if (isset($_POST['primary']) && ($_POST['primary'] == 'on')) $sql_data_array['customers_default_address_id'] = $new_address_book_id;
tep_db_perform(TABLE_CUSTOMERS, $sql_data_array, 'update', "customers_id = '" . (int)$customer_id . "'");
@@ -199,8 +199,8 @@
}
}
- if (isset($HTTP_GET_VARS['edit']) && is_numeric($HTTP_GET_VARS['edit'])) {
- $entry_query = tep_db_query("select entry_gender, entry_company, entry_firstname, entry_lastname, entry_street_address, entry_suburb, entry_postcode, entry_city, entry_state, entry_zone_id, entry_country_id from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$customer_id . "' and address_book_id = '" . (int)$HTTP_GET_VARS['edit'] . "'");
+ if (isset($_GET['edit']) && is_numeric($_GET['edit'])) {
+ $entry_query = tep_db_query("select entry_gender, entry_company, entry_firstname, entry_lastname, entry_street_address, entry_suburb, entry_postcode, entry_city, entry_state, entry_zone_id, entry_country_id from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$customer_id . "' and address_book_id = '" . (int)$_GET['edit'] . "'");
if (!tep_db_num_rows($entry_query)) {
$messageStack->add_session('addressbook', ERROR_NONEXISTING_ADDRESS_BOOK_ENTRY);
@@ -209,13 +209,13 @@
}
$entry = tep_db_fetch_array($entry_query);
- } elseif (isset($HTTP_GET_VARS['delete']) && is_numeric($HTTP_GET_VARS['delete'])) {
- if ($HTTP_GET_VARS['delete'] == $customer_default_address_id) {
+ } elseif (isset($_GET['delete']) && is_numeric($_GET['delete'])) {
+ if ($_GET['delete'] == $customer_default_address_id) {
$messageStack->add_session('addressbook', WARNING_PRIMARY_ADDRESS_DELETION, 'warning');
tep_redirect(tep_href_link(FILENAME_ADDRESS_BOOK, '', 'SSL'));
} else {
- $check_query = tep_db_query("select count(*) as total from " . TABLE_ADDRESS_BOOK . " where address_book_id = '" . (int)$HTTP_GET_VARS['delete'] . "' and customers_id = '" . (int)$customer_id . "'");
+ $check_query = tep_db_query("select count(*) as total from " . TABLE_ADDRESS_BOOK . " where address_book_id = '" . (int)$_GET['delete'] . "' and customers_id = '" . (int)$customer_id . "'");
$check = tep_db_fetch_array($check_query);
if ($check['total'] < 1) {
@@ -228,7 +228,7 @@
$entry = array();
}
- if (!isset($HTTP_GET_VARS['delete']) && !isset($HTTP_GET_VARS['edit'])) {
+ if (!isset($_GET['delete']) && !isset($_GET['edit'])) {
if (tep_count_customer_address_book_entries() >= MAX_ADDRESS_BOOK_ENTRIES) {
$messageStack->add_session('addressbook', ERROR_ADDRESS_BOOK_FULL);
@@ -239,22 +239,22 @@
$breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_ACCOUNT, '', 'SSL'));
$breadcrumb->add(NAVBAR_TITLE_2, tep_href_link(FILENAME_ADDRESS_BOOK, '', 'SSL'));
- if (isset($HTTP_GET_VARS['edit']) && is_numeric($HTTP_GET_VARS['edit'])) {
- $breadcrumb->add(NAVBAR_TITLE_MODIFY_ENTRY, tep_href_link(FILENAME_ADDRESS_BOOK_PROCESS, 'edit=' . $HTTP_GET_VARS['edit'], 'SSL'));
- } elseif (isset($HTTP_GET_VARS['delete']) && is_numeric($HTTP_GET_VARS['delete'])) {
- $breadcrumb->add(NAVBAR_TITLE_DELETE_ENTRY, tep_href_link(FILENAME_ADDRESS_BOOK_PROCESS, 'delete=' . $HTTP_GET_VARS['delete'], 'SSL'));
+ if (isset($_GET['edit']) && is_numeric($_GET['edit'])) {
+ $breadcrumb->add(NAVBAR_TITLE_MODIFY_ENTRY, tep_href_link(FILENAME_ADDRESS_BOOK_PROCESS, 'edit=' . $_GET['edit'], 'SSL'));
+ } elseif (isset($_GET['delete']) && is_numeric($_GET['delete'])) {
+ $breadcrumb->add(NAVBAR_TITLE_DELETE_ENTRY, tep_href_link(FILENAME_ADDRESS_BOOK_PROCESS, 'delete=' . $_GET['delete'], 'SSL'));
} else {
$breadcrumb->add(NAVBAR_TITLE_ADD_ENTRY, tep_href_link(FILENAME_ADDRESS_BOOK_PROCESS, '', 'SSL'));
}
require(DIR_WS_INCLUDES . 'template_top.php');
- if (!isset($HTTP_GET_VARS['delete'])) {
+ if (!isset($_GET['delete'])) {
include('includes/form_check.js.php');
}
?>
-<h1><?php if (isset($HTTP_GET_VARS['edit'])) { echo HEADING_TITLE_MODIFY_ENTRY; } elseif (isset($HTTP_GET_VARS['delete'])) { echo HEADING_TITLE_DELETE_ENTRY; } else { echo HEADING_TITLE_ADD_ENTRY; } ?></h1>
+<h1><?php if (isset($_GET['edit'])) { echo HEADING_TITLE_MODIFY_ENTRY; } elseif (isset($_GET['delete'])) { echo HEADING_TITLE_DELETE_ENTRY; } else { echo HEADING_TITLE_ADD_ENTRY; } ?></h1>
<?php
if ($messageStack->size('addressbook') > 0) {
@@ -263,7 +263,7 @@
?>
<?php
- if (isset($HTTP_GET_VARS['delete'])) {
+ if (isset($_GET['delete'])) {
?>
<div class="contentContainer">
@@ -272,11 +272,11 @@
<div class="contentText">
<p><?php echo DELETE_ADDRESS_DESCRIPTION; ?></p>
- <p><?php echo tep_address_label($customer_id, $HTTP_GET_VARS['delete'], true, ' ', '<br />'); ?></p>
+ <p><?php echo tep_address_label($customer_id, $_GET['delete'], true, ' ', '<br />'); ?></p>
</div>
<div>
- <span style="float: right;"><?php echo tep_draw_button(IMAGE_BUTTON_DELETE, 'trash', tep_href_link(FILENAME_ADDRESS_BOOK_PROCESS, 'delete=' . $HTTP_GET_VARS['delete'] . '&action=deleteconfirm&formid=' . md5($sessiontoken), 'SSL'), 'primary'); ?></span>
+ <span style="float: right;"><?php echo tep_draw_button(IMAGE_BUTTON_DELETE, 'trash', tep_href_link(FILENAME_ADDRESS_BOOK_PROCESS, 'delete=' . $_GET['delete'] . '&action=deleteconfirm&formid=' . md5($sessiontoken), 'SSL'), 'primary'); ?></span>
<?php echo tep_draw_button(IMAGE_BUTTON_BACK, 'triangle-1-w', tep_href_link(FILENAME_ADDRESS_BOOK, '', 'SSL')); ?>
</div>
@@ -286,18 +286,18 @@
} else {
?>
-<?php echo tep_draw_form('addressbook', tep_href_link(FILENAME_ADDRESS_BOOK_PROCESS, (isset($HTTP_GET_VARS['edit']) ? 'edit=' . $HTTP_GET_VARS['edit'] : ''), 'SSL'), 'post', 'onsubmit="return check_form(addressbook);"', true); ?>
+<?php echo tep_draw_form('addressbook', tep_href_link(FILENAME_ADDRESS_BOOK_PROCESS, (isset($_GET['edit']) ? 'edit=' . $_GET['edit'] : ''), 'SSL'), 'post', 'onsubmit="return check_form(addressbook);"', true); ?>
<div class="contentContainer">
<?php include(DIR_WS_MODULES . 'address_book_details.php'); ?>
<?php
- if (isset($HTTP_GET_VARS['edit']) && is_numeric($HTTP_GET_VARS['edit'])) {
+ if (isset($_GET['edit']) && is_numeric($_GET['edit'])) {
?>
<div>
- <span style="float: right;"><?php echo tep_draw_hidden_field('action', 'update') . tep_draw_hidden_field('edit', $HTTP_GET_VARS['edit']) . tep_draw_button(IMAGE_BUTTON_UPDATE, 'refresh', null, 'primary'); ?></span>
+ <span style="float: right;"><?php echo tep_draw_hidden_field('action', 'update') . tep_draw_hidden_field('edit', $_GET['edit']) . tep_draw_button(IMAGE_BUTTON_UPDATE, 'refresh', null, 'primary'); ?></span>
<?php echo tep_draw_button(IMAGE_BUTTON_BACK, 'triangle-1-w', tep_href_link(FILENAME_ADDRESS_BOOK, '', 'SSL')); ?>
</div>
View
18 catalog/checkout_confirmation.php
@@ -36,11 +36,11 @@
}
if (!tep_session_is_registered('payment')) tep_session_register('payment');
- if (isset($HTTP_POST_VARS['payment'])) $payment = $HTTP_POST_VARS['payment'];
+ if (isset($_POST['payment'])) $payment = $_POST['payment'];
if (!tep_session_is_registered('comments')) tep_session_register('comments');
- if (tep_not_null($HTTP_POST_VARS['comments'])) {
- $comments = tep_db_prepare_input($HTTP_POST_VARS['comments']);
+ if (tep_not_null($_POST['comments'])) {
+ $comments = tep_db_prepare_input($_POST['comments']);
}
// load the selected payment module
@@ -71,7 +71,8 @@
// Stock Check
$any_out_of_stock = false;
if (STOCK_CHECK == 'true') {
- for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {
+ $n=sizeof($order->products);
+ for ($i=0; $i<$n; $i++) {
if (tep_check_stock($order->products[$i]['id'], $order->products[$i]['qty'])) {
$any_out_of_stock = true;
}
@@ -164,7 +165,8 @@
<?php
}
- for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {
+ $n=sizeof($order->products);
+ for ($i=0; $i<$n; $i++) {
echo ' <tr>' . "\n" .
' <td align="right" valign="top" width="30">' . $order->products[$i]['qty'] . '&nbsp;x</td>' . "\n" .
' <td valign="top">' . $order->products[$i]['name'];
@@ -174,7 +176,8 @@
}
if ( (isset($order->products[$i]['attributes'])) && (sizeof($order->products[$i]['attributes']) > 0) ) {
- for ($j=0, $n2=sizeof($order->products[$i]['attributes']); $j<$n2; $j++) {
+ $n2=sizeof($order->products[$i]['attributes']);
+ for ($j=0; $j<$n2; $j++) {
echo '<br /><nobr><small>&nbsp;<i> - ' . $order->products[$i]['attributes'][$j]['option'] . ': ' . $order->products[$i]['attributes'][$j]['value'] . '</i></small></nobr>';
}
}
@@ -239,7 +242,8 @@
</tr>
<?php
- for ($i=0, $n=sizeof($confirmation['fields']); $i<$n; $i++) {
+$n=sizeof($confirmation['fields']);
+ for ($i=0; $i<$n; $i++) {
?>
<tr>
View
15 catalog/checkout_payment.php
@@ -38,7 +38,8 @@
// Stock Check
if ( (STOCK_CHECK == 'true') && (STOCK_ALLOW_CHECKOUT != 'true') ) {
$products = $cart->get_products();
- for ($i=0, $n=sizeof($products); $i<$n; $i++) {
+ $n=sizeof($products);
+ for ($i=0; $i<$n; $i++) {
if (tep_check_stock($products[$i]['id'], $products[$i]['quantity'])) {
tep_redirect(tep_href_link(FILENAME_SHOPPING_CART));
break;
@@ -67,8 +68,8 @@
$order = new order;
if (!tep_session_is_registered('comments')) tep_session_register('comments');
- if (isset($HTTP_POST_VARS['comments']) && tep_not_null($HTTP_POST_VARS['comments'])) {
- $comments = tep_db_prepare_input($HTTP_POST_VARS['comments']);
+ if (isset($_POST['comments']) && tep_not_null($_POST['comments'])) {
+ $comments = tep_db_prepare_input($_POST['comments']);
}
$total_weight = $cart->show_weight();
@@ -127,7 +128,7 @@ function rowOutEffect(object) {
<div class="contentContainer">
<?php
- if (isset($HTTP_GET_VARS['payment_error']) && is_object(${$HTTP_GET_VARS['payment_error']}) && ($error = ${$HTTP_GET_VARS['payment_error']}->get_error())) {
+ if (isset($_GET['payment_error']) && is_object(${$_GET['payment_error']}) && ($error = ${$_GET['payment_error']}->get_error())) {
?>
<div class="contentText">
@@ -188,7 +189,8 @@ function rowOutEffect(object) {
<?php
$radio_buttons = 0;
- for ($i=0, $n=sizeof($selection); $i<$n; $i++) {
+ $n=sizeof($selection);
+ for ($i=0; $i<$n; $i++) {
?>
<table border="0" width="100%" cellspacing="0" cellpadding="2">
@@ -231,7 +233,8 @@ function rowOutEffect(object) {
<td colspan="2"><table border="0" cellspacing="0" cellpadding="2">
<?php
- for ($j=0, $n2=sizeof($selection[$i]['fields']); $j<$n2; $j++) {
+ $n2=sizeof($selection[$i]['fields']);
+ for ($j=0; $j<$n2; $j++) {
?>
<tr>
View
34 catalog/checkout_payment_address.php
@@ -28,27 +28,27 @@
$error = false;
$process = false;
- if (isset($HTTP_POST_VARS['action']) && ($HTTP_POST_VARS['action'] == 'submit') && isset($HTTP_POST_VARS['formid']) && ($HTTP_POST_VARS['formid'] == $sessiontoken)) {
+ if (isset($_POST['action']) && ($_POST['action'] == 'submit') && isset($_POST['formid']) && ($_POST['formid'] == $sessiontoken)) {
// process a new billing address
- if (tep_not_null($HTTP_POST_VARS['firstname']) && tep_not_null($HTTP_POST_VARS['lastname']) && tep_not_null($HTTP_POST_VARS['street_address'])) {
+ if (tep_not_null($_POST['firstname']) && tep_not_null($_POST['lastname']) && tep_not_null($_POST['street_address'])) {
$process = true;
- if (ACCOUNT_GENDER == 'true') $gender = tep_db_prepare_input($HTTP_POST_VARS['gender']);
- if (ACCOUNT_COMPANY == 'true') $company = tep_db_prepare_input($HTTP_POST_VARS['company']);
- $firstname = tep_db_prepare_input($HTTP_POST_VARS['firstname']);
- $lastname = tep_db_prepare_input($HTTP_POST_VARS['lastname']);
- $street_address = tep_db_prepare_input($HTTP_POST_VARS['street_address']);
- if (ACCOUNT_SUBURB == 'true') $suburb = tep_db_prepare_input($HTTP_POST_VARS['suburb']);
- $postcode = tep_db_prepare_input($HTTP_POST_VARS['postcode']);
- $city = tep_db_prepare_input($HTTP_POST_VARS['city']);
- $country = tep_db_prepare_input($HTTP_POST_VARS['country']);
+ if (ACCOUNT_GENDER == 'true') $gender = tep_db_prepare_input($_POST['gender']);
+ if (ACCOUNT_COMPANY == 'true') $company = tep_db_prepare_input($_POST['company']);
+ $firstname = tep_db_prepare_input($_POST['firstname']);
+ $lastname = tep_db_prepare_input($_POST['lastname']);
+ $street_address = tep_db_prepare_input($_POST['street_address']);
+ if (ACCOUNT_SUBURB == 'true') $suburb = tep_db_prepare_input($_POST['suburb']);
+ $postcode = tep_db_prepare_input($_POST['postcode']);
+ $city = tep_db_prepare_input($_POST['city']);
+ $country = tep_db_prepare_input($_POST['country']);
if (ACCOUNT_STATE == 'true') {
- if (isset($HTTP_POST_VARS['zone_id'])) {
- $zone_id = tep_db_prepare_input($HTTP_POST_VARS['zone_id']);
+ if (isset($_POST['zone_id'])) {
+ $zone_id = tep_db_prepare_input($_POST['zone_id']);
} else {
$zone_id = false;
}
- $state = tep_db_prepare_input($HTTP_POST_VARS['state']);
+ $state = tep_db_prepare_input($_POST['state']);
}
if (ACCOUNT_GENDER == 'true') {
@@ -152,10 +152,10 @@
tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
}
// process the selected billing destination
- } elseif (isset($HTTP_POST_VARS['address'])) {
+ } elseif (isset($_POST['address'])) {
$reset_payment = false;
if (tep_session_is_registered('billto')) {
- if ($billto != $HTTP_POST_VARS['address']) {
+ if ($billto != $_POST['address']) {
if (tep_session_is_registered('payment')) {
$reset_payment = true;
}
@@ -164,7 +164,7 @@
tep_session_register('billto');
}
- $billto = $HTTP_POST_VARS['address'];
+ $billto = $_POST['address'];
$check_address_query = tep_db_query("select count(*) as total from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$customer_id . "' and address_book_id = '" . (int)$billto . "'");
$check_address = tep_db_fetch_array($check_address_query);
View
16 catalog/checkout_shipping.php
@@ -95,17 +95,17 @@
}
// process the selected shipping method
- if ( isset($HTTP_POST_VARS['action']) && ($HTTP_POST_VARS['action'] == 'process') && isset($HTTP_POST_VARS['formid']) && ($HTTP_POST_VARS['formid'] == $sessiontoken) ) {
+ if ( isset($_POST['action']) && ($_POST['action'] == 'process') && isset($_POST['formid']) && ($_POST['formid'] == $sessiontoken) ) {
if (!tep_session_is_registered('comments')) tep_session_register('comments');
- if (tep_not_null($HTTP_POST_VARS['comments'])) {
- $comments = tep_db_prepare_input($HTTP_POST_VARS['comments']);
+ if (tep_not_null($_POST['comments'])) {
+ $comments = tep_db_prepare_input($_POST['comments']);
}
if (!tep_session_is_registered('shipping')) tep_session_register('shipping');
if ( (tep_count_shipping_modules() > 0) || ($free_shipping == true) ) {
- if ( (isset($HTTP_POST_VARS['shipping'])) && (strpos($HTTP_POST_VARS['shipping'], '_')) ) {
- $shipping = $HTTP_POST_VARS['shipping'];
+ if ( (isset($_POST['shipping'])) && (strpos($_POST['shipping'], '_')) ) {
+ $shipping = $_POST['shipping'];
list($module, $method) = explode('_', $shipping);
if ( is_object($$module) || ($shipping == 'free_free') ) {
@@ -255,7 +255,8 @@ function rowOutEffect(object) {
<?php
} else {
$radio_buttons = 0;
- for ($i=0, $n=sizeof($quotes); $i<$n; $i++) {
+ $n=sizeof($quotes);
+ for ($i=0; $i<$n; $i++) {
?>
<tr>
@@ -272,7 +273,8 @@ function rowOutEffect(object) {
<?php
} else {
- for ($j=0, $n2=sizeof($quotes[$i]['methods']); $j<$n2; $j++) {
+ $n2=sizeof($quotes[$i]['methods']);
+ for ($j=0; $j<$n2; $j++) {
// set the radio button to be checked if it is the method chosen
$checked = (($quotes[$i]['id'] . '_' . $quotes[$i]['methods'][$j]['id'] == $shipping['id']) ? true : false);
View
36 catalog/checkout_shipping_address.php
@@ -12,7 +12,7 @@
require('includes/application_top.php');
-// if the customer is not logged on, redirect them to the login page
+// if thesize of customer is not logged on, redirect them to the login page
if (!tep_session_is_registered('customer_id')) {
$navigation->set_snapshot();
tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
@@ -41,27 +41,27 @@
$error = false;
$process = false;
- if (isset($HTTP_POST_VARS['action']) && ($HTTP_POST_VARS['action'] == 'submit') && isset($HTTP_POST_VARS['formid']) && ($HTTP_POST_VARS['formid'] == $sessiontoken)) {
+ if (isset($_POST['action']) && ($_POST['action'] == 'submit') && isset($_POST['formid']) && ($_POST['formid'] == $sessiontoken)) {
// process a new shipping address
- if (tep_not_null($HTTP_POST_VARS['firstname']) && tep_not_null($HTTP_POST_VARS['lastname']) && tep_not_null($HTTP_POST_VARS['street_address'])) {
+ if (tep_not_null($_POST['firstname']) && tep_not_null($_POST['lastname']) && tep_not_null($_POST['street_address'])) {
$process = true;
- if (ACCOUNT_GENDER == 'true') $gender = tep_db_prepare_input($HTTP_POST_VARS['gender']);
- if (ACCOUNT_COMPANY == 'true') $company = tep_db_prepare_input($HTTP_POST_VARS['company']);
- $firstname = tep_db_prepare_input($HTTP_POST_VARS['firstname']);
- $lastname = tep_db_prepare_input($HTTP_POST_VARS['lastname']);
- $street_address = tep_db_prepare_input($HTTP_POST_VARS['street_address']);
- if (ACCOUNT_SUBURB == 'true') $suburb = tep_db_prepare_input($HTTP_POST_VARS['suburb']);
- $postcode = tep_db_prepare_input($HTTP_POST_VARS['postcode']);
- $city = tep_db_prepare_input($HTTP_POST_VARS['city']);
- $country = tep_db_prepare_input($HTTP_POST_VARS['country']);
+ if (ACCOUNT_GENDER == 'true') $gender = tep_db_prepare_input($_POST['gender']);
+ if (ACCOUNT_COMPANY == 'true') $company = tep_db_prepare_input($_POST['company']);
+ $firstname = tep_db_prepare_input($_POST['firstname']);
+ $lastname = tep_db_prepare_input($_POST['lastname']);
+ $street_address = tep_db_prepare_input($_POST['street_address']);
+ if (ACCOUNT_SUBURB == 'true') $suburb = tep_db_prepare_input($_POST['suburb']);
+ $postcode = tep_db_prepare_input($_POST['postcode']);
+ $city = tep_db_prepare_input($_POST['city']);
+ $country = tep_db_prepare_input($_POST['country']);
if (ACCOUNT_STATE == 'true') {
- if (isset($HTTP_POST_VARS['zone_id'])) {
- $zone_id = tep_db_prepare_input($HTTP_POST_VARS['zone_id']);
+ if (isset($_POST['zone_id'])) {
+ $zone_id = tep_db_prepare_input($_POST['zone_id']);
} else {
$zone_id = false;
}
- $state = tep_db_prepare_input($HTTP_POST_VARS['state']);
+ $state = tep_db_prepare_input($_POST['state']);
}
if (ACCOUNT_GENDER == 'true') {
@@ -165,10 +165,10 @@
tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));
}
// process the selected shipping destination
- } elseif (isset($HTTP_POST_VARS['address'])) {
+ } elseif (isset($_POST['address'])) {
$reset_shipping = false;
if (tep_session_is_registered('sendto')) {
- if ($sendto != $HTTP_POST_VARS['address']) {
+ if ($sendto != $_POST['address']) {
if (tep_session_is_registered('shipping')) {
$reset_shipping = true;
}
@@ -177,7 +177,7 @@
tep_session_register('sendto');
}
- $sendto = $HTTP_POST_VARS['address'];
+ $sendto = $_POST['address'];
$check_address_query = tep_db_query("select count(*) as total from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$customer_id . "' and address_book_id = '" . (int)$sendto . "'");
$check_address = tep_db_fetch_array($check_address_query);
View
12 catalog/checkout_success.php
@@ -17,17 +17,18 @@
tep_redirect(tep_href_link(FILENAME_SHOPPING_CART));
}
- if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'update')) {
+ if (isset($_GET['action']) && ($_GET['action'] == 'update')) {
$notify_string = '';
- if (isset($HTTP_POST_VARS['notify']) && !empty($HTTP_POST_VARS['notify'])) {
- $notify = $HTTP_POST_VARS['notify'];
+ if (isset($_POST['notify']) && !empty($_POST['notify'])) {
+ $notify = $_POST['notify'];
if (!is_array($notify)) {
$notify = array($notify);
}
- for ($i=0, $n=sizeof($notify); $i<$n; $i++) {
+ $n=sizeof($notify);
+ for ($i=0; $i<$n; $i++) {
if (is_numeric($notify[$i])) {
$notify_string .= 'notify[]=' . $notify[$i] . '&';
}
@@ -80,7 +81,8 @@
echo TEXT_NOTIFY_PRODUCTS . '<br /><p class="productsNotifications">';
$products_displayed = array();
- for ($i=0, $n=sizeof($products_array); $i<$n; $i++) {
+ $n=sizeof($products_array);
+ for ($i=0; $i<$n; $i++) {
if (!in_array($products_array[$i]['id'], $products_displayed)) {
echo tep_draw_checkbox_field('notify[]', $products_array[$i]['id']) . ' ' . $products_array[$i]['text'] . '<br />';
$products_displayed[] = $products_array[$i]['id'];
View
4 catalog/product_reviews.php
@@ -12,11 +12,11 @@
require('includes/application_top.php');
- if (!isset($HTTP_GET_VARS['products_id']) || !is_numeric($HTTP_GET_VARS['products_id'])) {
+ if (!isset($_GET['products_id']) || !is_numeric($_GET['products_id'])) {
tep_redirect(tep_href_link(FILENAME_REVIEWS));
}
- $product_info_query = tep_db_query("select p.products_id, p.products_model, p.products_image, p.products_price, p.products_tax_class_id, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'");
+ $product_info_query = tep_db_query("select p.products_id, p.products_model, p.products_image, p.products_price, p.products_tax_class_id, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . (int)$_GET['products_id'] . "' and p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'");
if (!tep_db_num_rows($product_info_query)) {
tep_redirect(tep_href_link(FILENAME_REVIEWS));
} else {
Please sign in to comment.
Something went wrong with that request. Please try again.