diff --git a/htdocs/core/actions_extrafields.inc.php b/htdocs/core/actions_extrafields.inc.php index 74bf7c40ad8..70b173ab014 100644 --- a/htdocs/core/actions_extrafields.inc.php +++ b/htdocs/core/actions_extrafields.inc.php @@ -117,8 +117,8 @@ if ($action == 'add') if (! $error) { - // Type et taille non encore pris en compte => varchar(255) - if (isset($_POST["attrname"]) && preg_match("/^\w[a-zA-Z0-9-_]*$/",$_POST['attrname'])) + // attrname must be alphabetical and lower case only + if (isset($_POST["attrname"]) && preg_match("/^[a-z0-9-_]+$/",$_POST['attrname'])) { // Construct array for parameter (value of select list) $default_value = GETPOST('default_value'); @@ -159,7 +159,7 @@ if ($action == 'add') { $error++; $langs->load("errors"); - $mesg=$langs->trans("ErrorFieldCanNotContainSpecialCharacters",$langs->transnoentities("AttributeCode")); + $mesg=$langs->trans("ErrorFieldCanNotContainSpecialNorUpperCharacters",$langs->transnoentities("AttributeCode")); setEventMessage($mesg,'errors'); $action = 'create'; } diff --git a/htdocs/core/tpl/admin_extrafields_add.tpl.php b/htdocs/core/tpl/admin_extrafields_add.tpl.php index d1f8fc6bb37..e4c4d75c85e 100644 --- a/htdocs/core/tpl/admin_extrafields_add.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_add.tpl.php @@ -70,7 +70,7 @@ trans("Label"); ?> -trans("AttributeCode"); ?> (trans("AlphaNumOnlyCharsAndNoSpace"); ?>) +trans("AttributeCode"); ?> (trans("AlphaNumOnlyLowerCharsAndNoSpace"); ?>) trans("Type"); ?> selectarray('type',$type2label,GETPOST('type')); ?> diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index a72ab80eb3f..ee651563845 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -983,6 +983,7 @@ ExtraFieldsProject=Complementary attributes (projects) ExtraFieldsProjectTask=Complementary attributes (tasks) ExtraFieldHasWrongValue=Attribut %s has a wrong value. AlphaNumOnlyCharsAndNoSpace=only alphanumericals characters without space +AlphaNumOnlyLowerCharsAndNoSpace=only alphanumericals and lower case characters without space SendingMailSetup=Setup of sendings by email SendmailOptionNotComplete=Warning, on some Linux systems, to send email from your email, sendmail execution setup must contains option -ba (parameter mail.force_extra_parameters into your php.ini file). If some recipients never receive emails, try to edit this PHP parameter with mail.force_extra_parameters = -ba). PathToDocuments=Path to documents diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang index ac4d439a208..3ebd9720118 100644 --- a/htdocs/langs/en_US/errors.lang +++ b/htdocs/langs/en_US/errors.lang @@ -62,6 +62,7 @@ ErrorNoValueForCheckBoxType=Please fill value for checkbox list ErrorNoValueForRadioType=Please fill value for radio list ErrorBadFormatValueList=The list value cannot have more than one come : %s, but need at least one: llave,valores ErrorFieldCanNotContainSpecialCharacters=Field %s must not contains special characters. +ErrorFieldCanNotContainSpecialNorUpperCharacters=Field %s must not contains special characters, nor upper case characters. ErrorNoAccountancyModuleLoaded=No accountancy module activated ErrorExportDuplicateProfil=This profil name already exists for this export set. ErrorLDAPSetupNotComplete=Dolibarr-LDAP matching is not complete. diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index 9562d51fd58..244dc51d3db 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -983,6 +983,7 @@ ExtraFieldsProject=Attributs supplémentaires (projets) ExtraFieldsProjectTask=Attributs supplémentaires (tâches) ExtraFieldHasWrongValue=L'attribut %s a une valeur incorrecte. AlphaNumOnlyCharsAndNoSpace=uniquement caractères alphanumériques sans espace +AlphaNumOnlyLowerCharsAndNoSpace=uniquement caractères minuscules alphanumériques sans espace SendingMailSetup=Configuration de l'envoi par email SendmailOptionNotComplete=Attention, sur certains systèmes Linux, avec cette méthode d'envoi, pour pouvoir envoyer des emails en votre nom, la configuration d'exécution de sendmail doit contenir l'option -ba (paramètre mail.force_extra_parameters dans le fichier php.ini). Si certains de vos destinataires ne reçoivent pas de message, essayer de modifier ce paramètre PHP avec mail.force_extra_parameters = -ba. PathToDocuments=Chemin d'accès aux documents diff --git a/htdocs/langs/fr_FR/errors.lang b/htdocs/langs/fr_FR/errors.lang index 5dea9e06d48..a1ed822619e 100644 --- a/htdocs/langs/fr_FR/errors.lang +++ b/htdocs/langs/fr_FR/errors.lang @@ -62,6 +62,7 @@ ErrorNoValueForCheckBoxType=Les valeurs de la liste de case a cochées doivent ErrorNoValueForRadioType=Les valeurs de la liste d'options doivent être renseignées ErrorBadFormatValueList=Les valeurs de la liste ne peuvent pas contenir plus d'une virgule : %s, mais doivent en avoir au moins une: clef,valeur ErrorFieldCanNotContainSpecialCharacters=Le champ %s ne peut contenir de caractères spéciaux. +ErrorFieldCanNotContainSpecialNorUpperCharacters=Le champ %s ne peut contenir de caractères spéciaux, ni de caractères en majuscules. ErrorNoAccountancyModuleLoaded=Aucun module de comptabilité activé ErrorExportDuplicateProfil=Ce nom de profil existe déjà pour ce lot d'export. ErrorLDAPSetupNotComplete=Le matching Dolibarr-LDAP est incomplet.