Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions catalog/admin/includes/functions/html_output.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,10 +198,10 @@ function tep_draw_input_field($name, $value = '', $parameters = '', $required =

$field = '<input type="' . tep_output_string($type) . '" name="' . tep_output_string($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])) {
if ( $reinsert_value == true ) {
if ( isset($_GET[$name]) ) {
$value = stripslashes($_GET[$name]);
} elseif (isset($_POST[$name]) && is_string($_POST[$name])) {
} elseif ( isset($_POST[$name]) ) {
$value = stripslashes($_POST[$name]);
}
}
Expand Down Expand Up @@ -243,7 +243,7 @@ function tep_draw_selection_field($name, $type, $value = '', $checked = false, $

if (tep_not_null($value)) $selection .= ' value="' . tep_output_string($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))) || (tep_not_null($compare) && ($value == $compare)) ) {
if ( ($checked == true) || (isset($_GET[$name]) && (($_GET[$name] == 'on') || (stripslashes($_GET[$name]) == $value))) || (isset($_POST[$name]) && (($_POST[$name] == 'on') || (stripslashes($_POST[$name]) == $value))) || (tep_not_null($compare) && ($value == $compare)) ) {
$selection .= ' checked="checked"';
}

Expand Down Expand Up @@ -275,10 +275,10 @@ function tep_draw_textarea_field($name, $wrap, $width, $height, $text = '', $par

$field .= '>';

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])) {
if ( $reinsert_value == true ) {
if ( isset($_GET[$name]) ) {
$field .= tep_output_string_protected(stripslashes($_GET[$name]));
} elseif (isset($_POST[$name]) && is_string($_POST[$name])) {
} elseif ( isset($_POST[$name]) ) {
$field .= tep_output_string_protected(stripslashes($_POST[$name]));
}
} elseif (tep_not_null($text)) {
Expand All @@ -298,10 +298,10 @@ function tep_draw_hidden_field($name, $value = '', $parameters = '') {

if (tep_not_null($value)) {
$field .= ' value="' . tep_output_string($value) . '"';
} elseif ( (isset($_GET[$name]) && is_string($_GET[$name])) || (isset($_POST[$name]) && is_string($_POST[$name])) ) {
if ( (isset($_GET[$name]) && is_string($_GET[$name])) ) {
} elseif ( (isset($_GET[$name]) ) || (isset($_POST[$name]) ) ) {
if ( (isset($_GET[$name]) ) ) {
$field .= ' value="' . tep_output_string(stripslashes($_GET[$name])) . '"';
} elseif ( (isset($_POST[$name]) && is_string($_POST[$name])) ) {
} elseif ( isset($_POST[$name]) ) {
$field .= ' value="' . tep_output_string(stripslashes($_POST[$name])) . '"';
}
}
Expand Down Expand Up @@ -335,10 +335,10 @@ function tep_draw_pull_down_menu($name, $values, $default = '', $parameters = ''

$field .= '>';

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])) {
if ( empty($default) ) {
if ( isset($_GET[$name]) ) {
$default = stripslashes($_GET[$name]);
} elseif (isset($_POST[$name]) && is_string($_POST[$name])) {
} elseif ( isset($_POST[$name]) ) {
$default = stripslashes($_POST[$name]);
}
}
Expand Down
32 changes: 15 additions & 17 deletions catalog/includes/functions/html_output.php
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,10 @@ function tep_draw_form($name, $action, $method = 'post', $parameters = '', $toke
function tep_draw_input_field($name, $value = '', $parameters = '', $type = 'text', $reinsert_value = true, $class = 'form-control') {
$field = '<input type="' . tep_output_string($type) . '" name="' . tep_output_string($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])) {
if ( $reinsert_value == true ) {
if ( isset($_GET[$name]) ) {
$value = stripslashes($_GET[$name]);
} elseif (isset($_POST[$name]) && is_string($_POST[$name])) {
} elseif ( isset($_POST[$name]) ) {
$value = stripslashes($_POST[$name]);
}
}
Expand Down Expand Up @@ -212,7 +212,7 @@ function tep_draw_selection_field($name, $type, $value = '', $checked = false, $

if (tep_not_null($value)) $selection .= ' value="' . tep_output_string($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))) ) {
if ( ($checked == true) || (isset($_GET[$name]) && (($_GET[$name] == 'on') || (stripslashes($_GET[$name]) == $value))) || (isset($_POST[$name]) && (($_POST[$name] == 'on') || (stripslashes($_POST[$name]) == $value))) ) {
$selection .= ' checked="checked"';
}

Expand Down Expand Up @@ -248,10 +248,10 @@ function tep_draw_textarea_field($name, $wrap, $width, $height, $text = '', $par

$field .= '>';

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])) {
if ( $reinsert_value == true ) {
if ( isset($_GET[$name]) ) {
$field .= tep_output_string_protected(stripslashes($_GET[$name]));
} elseif (isset($_POST[$name]) && is_string($_POST[$name])) {
} elseif ( isset($_POST[$name]) ) {
$field .= tep_output_string_protected(stripslashes($_POST[$name]));
}
} elseif (tep_not_null($text)) {
Expand All @@ -268,14 +268,12 @@ function tep_draw_textarea_field($name, $wrap, $width, $height, $text = '', $par
function tep_draw_hidden_field($name, $value = '', $parameters = '') {
$field = '<input type="hidden" name="' . tep_output_string($name) . '"';

if (tep_not_null($value)) {
if ( tep_not_null($value) ) {
$field .= ' value="' . tep_output_string($value) . '"';
} 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])) . '"';
}
} elseif ( isset($_GET[$name]) ) {
$field .= ' value="' . tep_output_string(stripslashes($_GET[$name])) . '"';
} elseif ( isset($_POST[$name]) ) {
$field .= ' value="' . tep_output_string(stripslashes($_POST[$name])) . '"';
}

if (tep_not_null($parameters)) $field .= ' ' . $parameters;
Expand Down Expand Up @@ -307,10 +305,10 @@ function tep_draw_pull_down_menu($name, $values, $default = '', $parameters = ''

$field .= '>';

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])) {
if ( empty($default) ) {
if ( isset($_GET[$name]) ) {
$default = stripslashes($_GET[$name]);
} elseif (isset($_POST[$name]) && is_string($_POST[$name])) {
} elseif ( isset($_POST[$name]) ) {
$default = stripslashes($_POST[$name]);
}
}
Expand Down