Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
sg_mail
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TYPO3
sg_mail
Commits
20337e91
Commit
20337e91
authored
6 years ago
by
Paul Ilea
Browse files
Options
Downloads
Patches
Plain Diff
[TASK] Accept only alphanumeric values for forms marker names
parent
562c4ea5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Classes/Finisher/Forms/FormsFinisher.php
+6
-2
6 additions, 2 deletions
Classes/Finisher/Forms/FormsFinisher.php
Classes/XClass/Form/FormEditorController.php
+16
-7
16 additions, 7 deletions
Classes/XClass/Form/FormEditorController.php
with
22 additions
and
9 deletions
Classes/Finisher/Forms/FormsFinisher.php
+
6
−
2
View file @
20337e91
...
...
@@ -83,9 +83,13 @@ class FormsFinisher extends AbstractFinisher {
$formElementProperties
=
$formElement
->
getProperties
();
if
(
isset
(
$formElementProperties
[
'markerName'
])
&&
\trim
(
$formElementProperties
[
'markerName'
])
!==
''
)
{
$marker
s
[
\trim
(
$formElementProperties
[
'markerName'
])
]
=
$value
;
$marker
Name
=
\trim
(
$formElementProperties
[
'markerName'
]);
}
else
{
$markers
[
$identifier
]
=
$value
;
$markerName
=
$identifier
;
}
$markerName
=
preg_replace
(
'/[^a-zA-Z0-9]/'
,
''
,
$markerName
);
if
(
!
isset
(
$markers
[
$markerName
]))
{
$markers
[
$markerName
]
=
$value
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Classes/XClass/Form/FormEditorController.php
+
16
−
7
View file @
20337e91
...
...
@@ -168,13 +168,22 @@ class FormEditorController extends \TYPO3\CMS\Form\Controller\FormEditorControll
if
(
isset
(
$element
[
'properties'
][
'markerName'
])
&&
$element
[
'properties'
][
'markerName'
]
!==
''
)
{
$markerName
=
$element
[
'properties'
][
'markerName'
];
}
$markers
[]
=
[
'identifier'
=>
$markerName
,
'type'
=>
MailTemplateService
::
MARKER_TYPE_STRING
,
'value'
=>
$element
[
'label'
],
'description'
=>
$element
[
'label'
]
];
$markerName
=
preg_replace
(
'/[^a-zA-Z0-9]/'
,
''
,
$markerName
);
$duplicateMarker
=
FALSE
;
foreach
(
$markers
as
$marker
)
{
if
(
$marker
[
'identifier'
]
===
$markerName
)
{
$duplicateMarker
=
TRUE
;
break
;
}
}
if
(
!
$duplicateMarker
)
{
$markers
[]
=
[
'identifier'
=>
$markerName
,
'type'
=>
MailTemplateService
::
MARKER_TYPE_STRING
,
'value'
=>
$element
[
'label'
],
'description'
=>
$element
[
'label'
]
];
}
}
$registrationService
=
$this
->
objectManager
->
get
(
RegisterService
::
class
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment