Add test on url syntax
This commit is contained in:
parent
6b5b2145bc
commit
f78e12d7f8
@ -1,6 +1,7 @@
|
||||
# Dolibarr language file - en_US - companies
|
||||
CHARSET=UTF-8
|
||||
ErrorBadEMail=EMail %s is wrong
|
||||
ErrorBadUrl=Url %s is wrong
|
||||
ErrorCompanyNameAlreadyExists=Company name %s already exists. Choose another one.
|
||||
ErrorPrefixAlreadyExists=Prefix %s already exists. Choose another one.
|
||||
ErrorSetACountryFirst=Set the country first
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
# Dolibarr language file - fr_FR - companies
|
||||
CHARSET=UTF-8
|
||||
ErrorBadEMail=e-mail %s invalide
|
||||
ErrorBadUrl=Url %s invalide
|
||||
ErrorCompanyNameAlreadyExists=Le nom de société %s existe déjà. Veuillez en choisir un autre.
|
||||
ErrorPrefixAlreadyExists=Le préfixe %s existe déjà. Veuillez en choisir un autre.
|
||||
ErrorSetACountryFirst=Définissez d'abord le pays
|
||||
|
||||
@ -133,6 +133,12 @@ if ((! $_POST["getcustomercode"] && ! $_POST["getsuppliercode"])
|
||||
$soc->error = $langs->trans("ErrorBadEMail",$soc->email);
|
||||
$_GET["action"] = $_POST["action"]=='add'?'create':'edit';
|
||||
}
|
||||
if (! empty($soc->url) && ! isValidUrl($soc->url))
|
||||
{
|
||||
$error = 1;
|
||||
$soc->error = $langs->trans("ErrorBadUrl",$soc->url);
|
||||
$_GET["action"] = $_POST["action"]=='add'?'create':'edit';
|
||||
}
|
||||
if ($soc->fournisseur && ! $conf->fournisseur->enabled)
|
||||
{
|
||||
$error = 1;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user