Permalink
Browse files

Change the deprecated $HTTP_XXX_VARS to super global ones $_XXX

  • Loading branch information...
1 parent a13c766 commit e9f8cbdae91b9d5bff3215fdd1e0e977ab8d2c8a unknown committed Aug 14, 2011
@@ -282,7 +282,7 @@
if (!tep_session_is_registered('currency') || isset($_GET['currency']) || ( (USE_DEFAULT_LANGUAGE_CURRENCY == 'true') && (LANGUAGE_CURRENCY != $currency) ) ) {
if (!tep_session_is_registered('currency')) tep_session_register('currency');
- if (isset($_GET_VARS['currency']) && $currencies->is_set($_GET['currency'])) {
+ if (isset($_GET['currency']) && $currencies->is_set($_GET['currency'])) {
$currency = $_GET['currency'];
} else {
$currency = ((USE_DEFAULT_LANGUAGE_CURRENCY == 'true') && $currencies->is_set(LANGUAGE_CURRENCY)) ? LANGUAGE_CURRENCY : DEFAULT_CURRENCY;
@@ -15,15 +15,15 @@ class splitPageResults {
/* class constructor */
function splitPageResults($query, $max_rows, $count_key = '*', $page_holder = 'page') {
- global $HTTP_GET_VARS, $HTTP_POST_VARS;
+ global $_GET, $_POST;
$this->sql_query = $query;
$this->page_name = $page_holder;
- if (isset($HTTP_GET_VARS[$page_holder])) {
- $page = $HTTP_GET_VARS[$page_holder];
- } elseif (isset($HTTP_POST_VARS[$page_holder])) {
- $page = $HTTP_POST_VARS[$page_holder];
+ if (isset($_GET[$page_holder])) {
+ $page = $_GET[$page_holder];
+ } elseif (isset($_POST[$page_holder])) {
+ $page = $_POST[$page_holder];
} else {
$page = '';
}
@@ -167,14 +167,14 @@ function tep_break_string($string, $len, $break_char = '-') {
////
// Return all HTTP GET variables, except those passed as a parameter
function tep_get_all_get_params($exclude_array = '') {
- global $HTTP_GET_VARS;
+ global $_GET;
if (!is_array($exclude_array)) $exclude_array = array();
$get_url = '';
- if (is_array($HTTP_GET_VARS) && (sizeof($HTTP_GET_VARS) > 0)) {
+ if (is_array($_GET) && (sizeof($_GET) > 0)) {
- foreach($HTTP_GET_VARS as $key => $value) {
+ foreach($_GET as $key => $value) {
if ( is_string($value) && (strlen($value) > 0) && ($key != tep_session_name()) && ($key != 'error') && (!in_array($key, $exclude_array)) && ($key != 'x') && ($key != 'y') ) {
$get_url .= $key . '=' . rawurlencode(stripslashes($value)) . '&';
}
@@ -1277,13 +1277,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)) {
@@ -1292,19 +1292,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)) {
@@ -11,15 +11,15 @@
*/
function tep_check_gzip() {
- global $HTTP_ACCEPT_ENCODING;
+ global $_SERVER['HTTP_ACCEPT_ENCODING'];
if (headers_sent() || connection_aborted()) {
return false;
}
- if (strpos($HTTP_ACCEPT_ENCODING, 'x-gzip') !== false) return 'x-gzip';
+ if (strpos($_SERVER['HTTP_ACCEPT_LANGUAGE'], 'x-gzip') !== false) return 'x-gzip';
- if (strpos($HTTP_ACCEPT_ENCODING,'gzip') !== false) return 'gzip';
+ if (strpos($_SERVER['HTTP_ACCEPT_ENCODING'],'gzip') !== false) return 'gzip';
return false;
}

0 comments on commit e9f8cbd

Please sign in to comment.