From 6e059581dd07378a34d34e569a3bab8c41c14c4d Mon Sep 17 00:00:00 2001 From: Luca Date: Tue, 16 Aug 2011 18:29:42 +0200 Subject: [PATCH] UNDO --- catalog/admin/includes/functions/general.php | 4 +- .../admin/includes/functions/html_output.php | 27 ++++++----- catalog/includes/functions/general.php | 8 ++-- catalog/includes/functions/html_output.php | 48 +++++++++---------- 4 files changed, 46 insertions(+), 41 deletions(-) diff --git a/catalog/admin/includes/functions/general.php b/catalog/admin/includes/functions/general.php index 1f47014c7..9faa9f54d 100644 --- a/catalog/admin/includes/functions/general.php +++ b/catalog/admin/includes/functions/general.php @@ -265,7 +265,7 @@ function tep_values_name($values_id) { } function tep_info_image($image, $alt, $width = '', $height = '') { - if (tep_not_null($image) && (file_exists(DIR_FS_CATALOG_IMAGES . $image)) ) { + if (tep_not_null($image) && (file_exists(DIR_FS_CATALOG_IMAGES . $image)) ) { $image = tep_image(DIR_WS_CATALOG_IMAGES . $image, $alt, $width, $height); } else { $image = TEXT_IMAGE_NONEXISTENT; @@ -887,7 +887,7 @@ function tep_generate_category_path($id, $from = 'category', $categories_array = $category_query = tep_db_query("select cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . (int)$id . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "'"); $category = tep_db_fetch_array($category_query); $categories_array[$index][] = array('id' => $id, 'text' => $category['categories_name']); - if ( (tep_not_null($category['parent_id'])) && ($category['parent_id'] != '0') ) $categories_array = tep_generate_category_path($category['parent_id'], 'category', $categories_array, $index); + if ( (tep_not_null($category['parent_id'])) && ($category['parent_id'] != '0') ) $categories_array = tep_generate_category_path($category['parent_id'], 'category', $categories_array, $index); } return $categories_array; diff --git a/catalog/admin/includes/functions/html_output.php b/catalog/admin/includes/functions/html_output.php index af4215c55..2074921d7 100644 --- a/catalog/admin/includes/functions/html_output.php +++ b/catalog/admin/includes/functions/html_output.php @@ -96,7 +96,7 @@ function tep_image_submit($image, $alt = '', $parameters = '') { if (tep_not_null($alt)) $image_submit .= ' title=" ' . tep_output_string($alt) . ' "'; - if (tep_not_null($parameters)) $image_submit .= ' ' . $parameters; + if (tep_not_null($parameters)) $image_submit .= ' ' . $parameters; $image_submit .= ' />'; @@ -175,6 +175,7 @@ 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 $_GET, $_POST; $field = ' +?> \ No newline at end of file diff --git a/catalog/includes/functions/general.php b/catalog/includes/functions/general.php index 83552ccfb..7a9edeff8 100644 --- a/catalog/includes/functions/general.php +++ b/catalog/includes/functions/general.php @@ -450,7 +450,7 @@ function tep_address_format($address_format_id, $address, $html, $boln, $eoln) { $address_format = tep_db_fetch_array($address_format_query); $company = tep_output_string_protected($address['company']); - if (isset($address['firstname']) && tep_not_null($address['firstname'])) { + if (isset($address['firstname']) && tep_not_null($address['firstname'])) { $firstname = tep_output_string_protected($address['firstname']); $lastname = tep_output_string_protected($address['lastname']); } elseif (isset($address['name']) && tep_not_null($address['name'])) { @@ -467,10 +467,10 @@ function tep_address_format($address_format_id, $address, $html, $boln, $eoln) { if (isset($address['country_id']) && tep_not_null($address['country_id'])) { $country = tep_get_country_name($address['country_id']); - if (isset($address['zone_id']) && tep_not_null($address['zone_id'])) { + if (isset($address['zone_id']) && tep_not_null($address['zone_id'])) { $state = tep_get_zone_code($address['country_id'], $address['zone_id'], $state); } - } elseif (isset($address['country']) && isset($address['country'])) { + } elseif (isset($address['country']) && tep_not_null($address['country'])) { $country = tep_output_string_protected($address['country']['title']); } else { $country = ''; @@ -1366,4 +1366,4 @@ function tep_convert_linefeeds($from, $to, $string) { return str_replace($from, $to, $string); } } -?> +?> \ No newline at end of file diff --git a/catalog/includes/functions/html_output.php b/catalog/includes/functions/html_output.php index d3d46f372..7024731ca 100644 --- a/catalog/includes/functions/html_output.php +++ b/catalog/includes/functions/html_output.php @@ -17,7 +17,7 @@ function tep_href_link($page = '', $parameters = '', $connection = 'NONSSL', $ad $page = tep_output_string($page); - if (!tep_not_null($page)) { + if (!isset($page)) { $PHP_SELF = $_SERVER['PHP_SELF']; if ( empty($PHP_SELF) ) $_SERVER['PHP_SELF'] = $PHP_SELF = preg_replace("/(\?.*)?$/",'',$_SERVER["REQUEST_URI"]); @@ -48,7 +48,7 @@ function tep_href_link($page = '', $parameters = '', $connection = 'NONSSL', $ad // Add the session ID when moving from different HTTP and HTTPS servers, or when SID is defined if ( ($add_session_id == true) && ($session_started == true) && (SESSION_FORCE_COOKIE_USE == 'False') ) { - if (tep_not_null($SID)) { + if (isset($SID)) { $_sid = $SID; } elseif ( ( ($request_type == 'NONSSL') && ($connection == 'SSL') && (ENABLE_SSL == true) ) || ( ($request_type == 'SSL') && ($connection == 'NONSSL') ) ) { if (HTTP_COOKIE_DOMAIN != HTTPS_COOKIE_DOMAIN) { @@ -85,16 +85,16 @@ function tep_image($src, $alt = '', $width = '', $height = '', $parameters = '') // the image filename as default $image = '' . tep_output_string($alt) . ' +?> \ No newline at end of file