Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
fusiondirectory
fusiondirectory
Commits
9a14d14c
Commit
9a14d14c
authored
Dec 07, 2015
by
Côme Chilliet
Browse files
Fixes
#4343
Forbidding underscores in country names
parent
ab444fa0
Changes
2
Hide whitespace changes
Inline
Side-by-side
include/simpleplugin/class_attribute.inc
View file @
9a14d14c
...
...
@@ -808,7 +808,7 @@ class ObjectClassBooleanAttribute extends BooleanAttribute
*/
class
StringAttribute
extends
Attribute
{
pr
ivate
$pattern
;
pr
otected
$pattern
;
protected
$example
;
/*! \brief The constructor of StringAttribute
...
...
@@ -833,6 +833,11 @@ class StringAttribute extends Attribute
$this
->
example
=
$example
;
}
function
setPattern
(
$pattern
)
{
$this
->
pattern
=
$pattern
;
}
function
renderFormInput
()
{
$id
=
$this
->
getHtmlId
();
...
...
plugins/admin/departments/class_country.inc
View file @
9a14d14c
...
...
@@ -50,6 +50,8 @@ class country extends department
$attributesInfo
=
parent
::
getDepartmentAttributesInfo
(
_
(
'country'
),
self
::
$namingAttr
);
unset
(
$attributesInfo
[
'location'
]);
unset
(
$attributesInfo
[
'properties'
][
'attrs'
][
3
]);
// category
/* Country c attribut cannot contain any underscore */
$attributesInfo
[
'properties'
][
'attrs'
][
1
]
->
setPattern
(
'/^[a-z0-9\.-]+$/i'
);
return
$attributesInfo
;
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment