From c041feec6ab7cc4c9232cf146181f42e3eabda86 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 20 Jun 2012 22:23:43 +0200 Subject: [PATCH] Fix: missing not empty test --- htdocs/master.inc.php | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/htdocs/master.inc.php b/htdocs/master.inc.php index 00fa42e21f0..cb3518f664d 100644 --- a/htdocs/master.inc.php +++ b/htdocs/master.inc.php @@ -1,4 +1,4 @@ - * Copyright (C) 2003 Xavier Dutoit * Copyright (C) 2004-2012 Laurent Destailleur @@ -206,20 +206,24 @@ if (! defined('NOREQUIREDB') && ! defined('NOREQUIRESOC')) $mysoc->note=empty($conf->global->MAIN_INFO_SOCIETE_NOTE)?'':$conf->global->MAIN_INFO_SOCIETE_NOTE; // We define pays_id, pays_code and country - $tmp=explode(':',$conf->global->MAIN_INFO_SOCIETE_PAYS); - $country_id=$tmp[0]; - if (! empty($tmp[1])) // If $conf->global->MAIN_INFO_SOCIETE_PAYS is "id:code:label" + if (! empty($conf->global->MAIN_INFO_SOCIETE_PAYS)) { - $country_code=$tmp[1]; - $country_label=$tmp[2]; - } - else // For backward compatibility - { - dol_syslog("Your country setup use an old syntax. Reedit it in setup area.", LOG_WARNING); - include_once(DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'); - $country_code=getCountry($country_id,2,$db); // This need a SQL request, but it's the old feature - $country_label=getCountry($country_id,0,$db); // This need a SQL request, but it's the old feature + $tmp=explode(':',$conf->global->MAIN_INFO_SOCIETE_PAYS); + $country_id=$tmp[0]; + if (! empty($tmp[1])) // If $conf->global->MAIN_INFO_SOCIETE_PAYS is "id:code:label" + { + $country_code=$tmp[1]; + $country_label=$tmp[2]; + } + else // For backward compatibility + { + dol_syslog("Your country setup use an old syntax. Reedit it in setup area.", LOG_WARNING); + include_once(DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'); + $country_code=getCountry($country_id,2,$db); // This need a SQL request, but it's the old feature + $country_label=getCountry($country_id,0,$db); // This need a SQL request, but it's the old feature + } } + $mysoc->pays_id=$country_id; // TODO deprecated $mysoc->country_id=$country_id; $mysoc->pays_code=$country_code; // TODO deprecated