If this is your first visit, check our documentation. To post, register or login.
Forums / Code Matters / Bug Reports / Undefined variable $country in /includes/modules/create_account.php

Undefined variable $country in /includes/modules/create_account.php

Started by yesaul on 9 Dec 2023, 3:16 PM · Views: 704

Results 1 to 1 of 1
9 Dec 2023, 3:16 PM
#1
yesaul avatar

yesaul

New Zenner

Join Date:
Apr 2011
Location:
Espoo, Finland
Posts:
73
Plugin Contributions:
0

Post #1 by yesaul

Good day,

Sorry (if I do understand sometyhng wrong or issue has been already described), but the following code in create_account.php module can cause "Undefined variable" warning:

/**
 * Process form contents
 */
if (isset($_POST['action']) && ($_POST['action'] == 'process') && !isset($login_page)) {
...
    [B]$country[/B] = zen_db_prepare_input($_POST['zone_country_id']);
...
}

/*
 * Set flags for template use:
 */
$selected_country = (isset($_POST['zone_country_id']) && $_POST['zone_country_id'] != '') ?  [B]$country[/B] : SHOW_CREATE_ACCOUNT_DEFAULT_COUNTRY;
...

My homble suggestion (line 401):

$selected_country = !empty($_POST['zone_country_id']) ? zen_db_prepare_input($_POST['zone_country_id']) : SHOW_CREATE_ACCOUNT_DEFAULT_COUNTRY;