Permalink
Browse files

Change to deprecated $HTTP_GET_VARS and $HTTP_POST_VARS to they $_GET…

… and $_POST alternatives
  • Loading branch information...
1 parent 7dbcdd2 commit a13c766e51b4d1b681ec64c87a29ae53281aefc2 unknown committed Aug 14, 2011
Showing with 26 additions and 26 deletions.
  1. +26 −26 catalog/includes/functions/html_output.php
@@ -166,15 +166,15 @@ function tep_draw_form($name, $action, $method = 'post', $parameters = '', $toke
////
// Output a form input field
function tep_draw_input_field($name, $value = '', $parameters = '', $type = 'text', $reinsert_value = true) {
- global $HTTP_GET_VARS, $HTTP_POST_VARS;
+ global $_GET, $_POST;
$field = '<input type="' . tep_output_string($type) . '" name="' . tep_output_string($name) . '"';
- if ( ($reinsert_value == true) && ( (isset($HTTP_GET_VARS[$name]) && is_string($HTTP_GET_VARS[$name])) || (isset($HTTP_POST_VARS[$name]) && is_string($HTTP_POST_VARS[$name])) ) ) {
- if (isset($HTTP_GET_VARS[$name]) && is_string($HTTP_GET_VARS[$name])) {
- $value = stripslashes($HTTP_GET_VARS[$name]);
- } elseif (isset($HTTP_POST_VARS[$name]) && is_string($HTTP_POST_VARS[$name])) {
- $value = stripslashes($HTTP_POST_VARS[$name]);
+ if ( ($reinsert_value == true) && ( (isset($_GET[$name]) && is_string($_GET[$name])) || (isset($_POST[$name]) && is_string($_POST[$name])) ) ) {
+ if (isset($_GET[$name]) && is_string($_GET[$name])) {
+ $value = stripslashes($_GET[$name]);
+ } elseif (isset($_POST[$name]) && is_string($_POST[$name])) {
+ $value = stripslashes($_POST[$name]);
}
}
@@ -198,13 +198,13 @@ function tep_draw_password_field($name, $value = '', $parameters = 'maxlength="4
////
// Output a selection field - alias function for tep_draw_checkbox_field() and tep_draw_radio_field()
function tep_draw_selection_field($name, $type, $value = '', $checked = false, $parameters = '') {
- global $HTTP_GET_VARS, $HTTP_POST_VARS;
+ global $_GET, $_POST;
$selection = '<input type="' . tep_output_string($type) . '" name="' . tep_output_string($name) . '"';
if (tep_not_null($value)) $selection .= ' value="' . tep_output_string($value) . '"';
- if ( ($checked == true) || (isset($HTTP_GET_VARS[$name]) && is_string($HTTP_GET_VARS[$name]) && (($HTTP_GET_VARS[$name] == 'on') || (stripslashes($HTTP_GET_VARS[$name]) == $value))) || (isset($HTTP_POST_VARS[$name]) && is_string($HTTP_POST_VARS[$name]) && (($HTTP_POST_VARS[$name] == 'on') || (stripslashes($HTTP_POST_VARS[$name]) == $value))) ) {
+ if ( ($checked == true) || (isset($_GET[$name]) && is_string($_GET[$name]) && (($_GET[$name] == 'on') || (stripslashes($_GET[$name]) == $value))) || (isset($_POST[$name]) && is_string($_POST[$name]) && (($_POST[$name] == 'on') || (stripslashes($_POST[$name]) == $value))) ) {
$selection .= ' checked="checked"';
}
@@ -231,19 +231,19 @@ function tep_draw_radio_field($name, $value = '', $checked = false, $parameters
// Output a form textarea field
// The $wrap parameter is no longer used in the core xhtml template
function tep_draw_textarea_field($name, $wrap, $width, $height, $text = '', $parameters = '', $reinsert_value = true) {
- global $HTTP_GET_VARS, $HTTP_POST_VARS;
+ global $_GET, $_POST;
$field = '<textarea name="' . tep_output_string($name) . '" cols="' . tep_output_string($width) . '" rows="' . tep_output_string($height) . '"';
if (tep_not_null($parameters)) $field .= ' ' . $parameters;
$field .= '>';
- if ( ($reinsert_value == true) && ( (isset($HTTP_GET_VARS[$name]) && is_string($HTTP_GET_VARS[$name])) || (isset($HTTP_POST_VARS[$name]) && is_string($HTTP_POST_VARS[$name])) ) ) {
- if (isset($HTTP_GET_VARS[$name]) && is_string($HTTP_GET_VARS[$name])) {
- $field .= tep_output_string_protected(stripslashes($HTTP_GET_VARS[$name]));
- } elseif (isset($HTTP_POST_VARS[$name]) && is_string($HTTP_POST_VARS[$name])) {
- $field .= tep_output_string_protected(stripslashes($HTTP_POST_VARS[$name]));
+ if ( ($reinsert_value == true) && ( (isset($_GET[$name]) && is_string($_GET[$name])) || (isset($_POST[$name]) && is_string($_POST[$name])) ) ) {
+ if (isset($_GET[$name]) && is_string($_GET[$name])) {
+ $field .= tep_output_string_protected(stripslashes($_GET[$name]));
+ } elseif (isset($_POST[$name]) && is_string($_POST[$name])) {
+ $field .= tep_output_string_protected(stripslashes($_POST[$name]));
}
} elseif (tep_not_null($text)) {
$field .= tep_output_string_protected($text);
@@ -257,17 +257,17 @@ function tep_draw_textarea_field($name, $wrap, $width, $height, $text = '', $par
////
// Output a form hidden field
function tep_draw_hidden_field($name, $value = '', $parameters = '') {
- global $HTTP_GET_VARS, $HTTP_POST_VARS;
+ global $_GET, $_POST;
$field = '<input type="hidden" name="' . tep_output_string($name) . '"';
if (tep_not_null($value)) {
$field .= ' value="' . tep_output_string($value) . '"';
- } elseif ( (isset($HTTP_GET_VARS[$name]) && is_string($HTTP_GET_VARS[$name])) || (isset($HTTP_POST_VARS[$name]) && is_string($HTTP_POST_VARS[$name])) ) {
- if ( (isset($HTTP_GET_VARS[$name]) && is_string($HTTP_GET_VARS[$name])) ) {
- $field .= ' value="' . tep_output_string(stripslashes($HTTP_GET_VARS[$name])) . '"';
- } elseif ( (isset($HTTP_POST_VARS[$name]) && is_string($HTTP_POST_VARS[$name])) ) {
- $field .= ' value="' . tep_output_string(stripslashes($HTTP_POST_VARS[$name])) . '"';
+ } elseif ( (isset($_GET[$name]) && is_string($_GET[$name])) || (isset($_POST[$name]) && is_string($_POST[$name])) ) {
+ if ( (isset($_GET[$name]) && is_string($_GET[$name])) ) {
+ $field .= ' value="' . tep_output_string(stripslashes($_GET[$name])) . '"';
+ } elseif ( (isset($_POST[$name]) && is_string($_POST[$name])) ) {
+ $field .= ' value="' . tep_output_string(stripslashes($_POST[$name])) . '"';
}
}
@@ -291,19 +291,19 @@ function tep_hide_session_id() {
////
// Output a form pull down menu
function tep_draw_pull_down_menu($name, $values, $default = '', $parameters = '', $required = false) {
- global $HTTP_GET_VARS, $HTTP_POST_VARS;
+ global $_GET, $_POST;
$field = '<select name="' . tep_output_string($name) . '"';
if (tep_not_null($parameters)) $field .= ' ' . $parameters;
$field .= '>';
- if (empty($default) && ( (isset($HTTP_GET_VARS[$name]) && is_string($HTTP_GET_VARS[$name])) || (isset($HTTP_POST_VARS[$name]) && is_string($HTTP_POST_VARS[$name])) ) ) {
- if (isset($HTTP_GET_VARS[$name]) && is_string($HTTP_GET_VARS[$name])) {
- $default = stripslashes($HTTP_GET_VARS[$name]);
- } elseif (isset($HTTP_POST_VARS[$name]) && is_string($HTTP_POST_VARS[$name])) {
- $default = stripslashes($HTTP_POST_VARS[$name]);
+ if (empty($default) && ( (isset($_GET[$name]) && is_string($_GET[$name])) || (isset($_POST[$name]) && is_string($_POST[$name])) ) ) {
+ if (isset($_GET[$name]) && is_string($_GET[$name])) {
+ $default = stripslashes($_GET[$name]);
+ } elseif (isset($_POST[$name]) && is_string($_POST[$name])) {
+ $default = stripslashes($_POST[$name]);
}
}

0 comments on commit a13c766

Please sign in to comment.