Add test on url syntax

This commit is contained in:
Laurent Destailleur 2009-10-23 23:25:07 +00:00
parent 6b5b2145bc
commit f78e12d7f8
3 changed files with 8 additions and 0 deletions

View File

@ -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

View File

@ -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

View File

@ -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;