Skip to content
Snippets Groups Projects
Commit f78e12d7 authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Add test on url syntax

parent 6b5b2145
No related branches found
No related tags found
No related merge requests found
# Dolibarr language file - en_US - companies # Dolibarr language file - en_US - companies
CHARSET=UTF-8 CHARSET=UTF-8
ErrorBadEMail=EMail %s is wrong ErrorBadEMail=EMail %s is wrong
ErrorBadUrl=Url %s is wrong
ErrorCompanyNameAlreadyExists=Company name %s already exists. Choose another one. ErrorCompanyNameAlreadyExists=Company name %s already exists. Choose another one.
ErrorPrefixAlreadyExists=Prefix %s already exists. Choose another one. ErrorPrefixAlreadyExists=Prefix %s already exists. Choose another one.
ErrorSetACountryFirst=Set the country first ErrorSetACountryFirst=Set the country first
......
# Dolibarr language file - fr_FR - companies # Dolibarr language file - fr_FR - companies
CHARSET=UTF-8 CHARSET=UTF-8
ErrorBadEMail=e-mail %s invalide ErrorBadEMail=e-mail %s invalide
ErrorBadUrl=Url %s invalide
ErrorCompanyNameAlreadyExists=Le nom de société %s existe déjà. Veuillez en choisir un autre. 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. ErrorPrefixAlreadyExists=Le préfixe %s existe déjà. Veuillez en choisir un autre.
ErrorSetACountryFirst=Définissez d'abord le pays ErrorSetACountryFirst=Définissez d'abord le pays
......
...@@ -133,6 +133,12 @@ if ((! $_POST["getcustomercode"] && ! $_POST["getsuppliercode"]) ...@@ -133,6 +133,12 @@ if ((! $_POST["getcustomercode"] && ! $_POST["getsuppliercode"])
$soc->error = $langs->trans("ErrorBadEMail",$soc->email); $soc->error = $langs->trans("ErrorBadEMail",$soc->email);
$_GET["action"] = $_POST["action"]=='add'?'create':'edit'; $_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) if ($soc->fournisseur && ! $conf->fournisseur->enabled)
{ {
$error = 1; $error = 1;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment