mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
N°931: Fix integrity controls (tag code length)
This commit is contained in:
@@ -139,7 +139,7 @@ abstract class TagSetFieldData extends cmdbAbstractObject
|
||||
// Check that code and labels are uniques
|
||||
$sTagCode = $this->Get('tag_code');
|
||||
// Check tag_code syntax
|
||||
if (!preg_match("@^[a-zA-Z0-9]{1,20}$@", $sTagCode))
|
||||
if (!preg_match("@^[a-zA-Z0-9]{3,20}$@", $sTagCode))
|
||||
{
|
||||
$this->m_aCheckIssues[] = Dict::S('Core:TagSetFieldData:ErrorTagCodeSyntax');
|
||||
}
|
||||
|
||||
@@ -919,7 +919,7 @@ Dict::Add('EN US', 'English', 'English', array(
|
||||
'Class:TagSetFieldData+' => '',
|
||||
'Core:TagSetFieldData:ErrorDeleteUsedTag' => 'Used tags cannot be deleted',
|
||||
'Core:TagSetFieldData:ErrorDuplicateTagCodeOrLabel' => 'Tags codes or labels must be unique',
|
||||
'Core:TagSetFieldData:ErrorTagCodeSyntax' => 'Tags code should match [a-zA-Z0-9]{1,20} syntax',
|
||||
'Core:TagSetFieldData:ErrorTagCodeSyntax' => 'Tags code should contain between 3 and 20 alphanumeric characters',
|
||||
'Core:TagSetFieldData:ErrorTagLabelSyntax' => 'Tags label should not contain | nor be empty',
|
||||
'Core:TagSetFieldData:ErrorCodeUpdateNotAllowed' => 'Tags code cannot be changed',
|
||||
));
|
||||
|
||||
@@ -767,7 +767,7 @@ Opérateurs :<br/>
|
||||
'Core:Validator:MustSelectOne' => 'Veuillez choisir une valeur',
|
||||
'Core:TagSetFieldData:ErrorDeleteUsedTag' => 'Impossible de supprimer une étiquette utilisée',
|
||||
'Core:TagSetFieldData:ErrorDuplicateTagCodeOrLabel' => 'Les codes et noms des étiquettes doivent être unique',
|
||||
'Core:TagSetFieldData:ErrorTagCodeSyntax' => 'Le code de l\'étiquette doit avoir la syntaxe suivante : [a-zA-Z0-9]{1,20}',
|
||||
'Core:TagSetFieldData:ErrorTagCodeSyntax' => 'Le code de l\'étiquette doit contenir entre 3 et 20 caractères alphanumériques.',
|
||||
'Core:TagSetFieldData:ErrorTagLabelSyntax' => 'Le nom de l\'étiquette ne doit pas être vide ni contenir le caractère \'|\'',
|
||||
'Core:TagSetFieldData:ErrorCodeUpdateNotAllowed' => 'Le code de l\'étiquette ne peut pas être changé',
|
||||
));
|
||||
|
||||
@@ -165,7 +165,9 @@ class TagSetFieldDataTest extends ItopDataTestCase
|
||||
'No -' => array('tag-1'),
|
||||
'No %' => array('tag%1'),
|
||||
'Less than 21 chars' => array('012345678901234567890'),
|
||||
'At least one char' => array(''),
|
||||
'At least 3 chars' => array(''),
|
||||
'At least 3 chars 1' => array('a'),
|
||||
'At least 3 chars 2' => array('ab'),
|
||||
'No #' => array('#tag'),
|
||||
'No !' => array('tag!'),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user