Fix change info when config.account_country is disabled

Some PHP warnings and notices
This commit is contained in:
slawkens 2020-03-14 14:24:14 +01:00
parent c991e085d4
commit b7bb570420

View File

@ -39,23 +39,24 @@ if(isset($_POST['changeinfosave']) && $_POST['changeinfosave'] == 1) {
if($show_form) { if($show_form) {
$account_rlname = $account_logged->getCustomField("rlname"); $account_rlname = $account_logged->getCustomField("rlname");
$account_location = $account_logged->getCustomField("location"); $account_location = $account_logged->getCustomField("location");
if ($config['account_country']) if ($config['account_country']) {
$account_country = $account_logged->getCustomField("country"); $account_country = $account_logged->getCustomField("country");
$countries = array(); $countries = array();
foreach (array('pl', 'se', 'br', 'us', 'gb',) as $country) foreach (array('pl', 'se', 'br', 'us', 'gb',) as $country)
$countries[$country] = $config['countries'][$country]; $countries[$country] = $config['countries'][$country];
$countries['--'] = '----------'; $countries['--'] = '----------';
foreach ($config['countries'] as $code => $country) foreach ($config['countries'] as $code => $country)
$countries[$code] = $country; $countries[$code] = $country;
}
$twig->display('account.change_info.html.twig', array( $twig->display('account.change_info.html.twig', array(
'countries' => $countries, 'countries' => isset($countries) ? $countries : [],
'account_rlname' => $account_rlname, 'account_rlname' => $account_rlname,
'account_location' => $account_location, 'account_location' => $account_location,
'account_country' => $account_country 'account_country' => isset($account_country) ? $account_country : ''
)); ));
} }
?> ?>