From c54aa28778dcd48ad7ab6d07ab90e1e864e3b59f Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 14 Aug 2011 15:58:11 +0200 Subject: [PATCH] Change the deprecated $HTTP_XXX_VARS to super global ones $_XXX --- catalog/admin/includes/functions/general.php | 30 +++++------ .../admin/includes/functions/html_output.php | 52 +++++++++---------- catalog/admin/includes/functions/sessions.php | 18 +++---- 3 files changed, 50 insertions(+), 50 deletions(-) diff --git a/catalog/admin/includes/functions/general.php b/catalog/admin/includes/functions/general.php index fc4ccf9a5..9b490cf26 100644 --- a/catalog/admin/includes/functions/general.php +++ b/catalog/admin/includes/functions/general.php @@ -117,14 +117,14 @@ function tep_get_path($current_category_id = '') { } function tep_get_all_get_params($exclude_array = '') { - global $HTTP_GET_VARS; + global $_GET; if ($exclude_array == '') $exclude_array = array(); $get_url = ''; - reset($HTTP_GET_VARS); - while (list($key, $value) = each($HTTP_GET_VARS)) { + reset($_GET); + while (list($key, $value) = each($_GET)) { if (($key != tep_session_name()) && ($key != 'error') && (!in_array($key, $exclude_array))) $get_url .= $key . '=' . $value . '&'; } @@ -821,7 +821,7 @@ function tep_mod_select_option($select_array, $key_name, $key_value) { //// // Retreive server information function tep_get_system_information() { - global $HTTP_SERVER_VARS; + global $_SERVER; $db_query = tep_db_query("select now() as datetime"); $db = tep_db_fetch_array($db_query); @@ -836,7 +836,7 @@ function tep_get_system_information() { 'os' => PHP_OS, 'kernel' => $kernel, 'uptime' => @exec('uptime'), - 'http_server' => $HTTP_SERVER_VARS['SERVER_SOFTWARE']); + 'http_server' => $_SERVER['SERVER_SOFTWARE']); $data['mysql'] = array('version' => (function_exists('mysql_get_server_info') ? mysql_get_server_info() : ''), 'date' => $db['datetime']); @@ -1408,13 +1408,13 @@ function tep_validate_ip_address($ip_address) { } function tep_get_ip_address() { - global $HTTP_SERVER_VARS; + global $_SERVER; $ip_address = null; $ip_addresses = array(); - if (isset($HTTP_SERVER_VARS['HTTP_X_FORWARDED_FOR']) && !empty($HTTP_SERVER_VARS['HTTP_X_FORWARDED_FOR'])) { - foreach ( array_reverse(explode(',', $HTTP_SERVER_VARS['HTTP_X_FORWARDED_FOR'])) as $x_ip ) { + if (isset($_SERVER['HTTP_X_FORWARDED_FOR']) && !empty($_SERVER['HTTP_X_FORWARDED_FOR'])) { + foreach ( array_reverse(explode(',', $_SERVER['HTTP_X_FORWARDED_FOR'])) as $x_ip ) { $x_ip = trim($x_ip); if (tep_validate_ip_address($x_ip)) { @@ -1423,19 +1423,19 @@ function tep_get_ip_address() { } } - if (isset($HTTP_SERVER_VARS['HTTP_CLIENT_IP']) && !empty($HTTP_SERVER_VARS['HTTP_CLIENT_IP'])) { - $ip_addresses[] = $HTTP_SERVER_VARS['HTTP_CLIENT_IP']; + if (isset($_SERVER['HTTP_CLIENT_IP']) && !empty($_SERVER['HTTP_CLIENT_IP'])) { + $ip_addresses[] = $_SERVER['HTTP_CLIENT_IP']; } - if (isset($HTTP_SERVER_VARS['HTTP_X_CLUSTER_CLIENT_IP']) && !empty($HTTP_SERVER_VARS['HTTP_X_CLUSTER_CLIENT_IP'])) { - $ip_addresses[] = $HTTP_SERVER_VARS['HTTP_X_CLUSTER_CLIENT_IP']; + if (isset($_SERVER['HTTP_X_CLUSTER_CLIENT_IP']) && !empty($_SERVER['HTTP_X_CLUSTER_CLIENT_IP'])) { + $ip_addresses[] = $_SERVER['HTTP_X_CLUSTER_CLIENT_IP']; } - if (isset($HTTP_SERVER_VARS['HTTP_PROXY_USER']) && !empty($HTTP_SERVER_VARS['HTTP_PROXY_USER'])) { - $ip_addresses[] = $HTTP_SERVER_VARS['HTTP_PROXY_USER']; + if (isset($_SERVER['HTTP_PROXY_USER']) && !empty($_SERVER['HTTP_PROXY_USER'])) { + $ip_addresses[] = $_SERVER['HTTP_PROXY_USER']; } - $ip_addresses[] = $HTTP_SERVER_VARS['REMOTE_ADDR']; + $ip_addresses[] = $_SERVER['REMOTE_ADDR']; foreach ( $ip_addresses as $ip ) { if (!empty($ip) && tep_validate_ip_address($ip)) { diff --git a/catalog/admin/includes/functions/html_output.php b/catalog/admin/includes/functions/html_output.php index 3b3efbc47..cc908f9a9 100644 --- a/catalog/admin/includes/functions/html_output.php +++ b/catalog/admin/includes/functions/html_output.php @@ -172,15 +172,15 @@ function tep_draw_form($name, $action, $parameters = '', $method = 'post', $para //// // Output a form input field function tep_draw_input_field($name, $value = '', $parameters = '', $required = false, $type = 'text', $reinsert_value = true) { - global $HTTP_GET_VARS, $HTTP_POST_VARS; + global $_GET, $_POST; $field = '