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
1d297039
Commit
1d297039
authored
6 years ago
by
Torsten Oppermann
Browse files
Options
Downloads
Patches
Plain Diff
[TASK] Fixing a bug with the file security hash
parent
29f9c7fb
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!11
Feature security update
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Classes/XClass/Form/FormEditorController.php
+33
-35
33 additions, 35 deletions
Classes/XClass/Form/FormEditorController.php
with
33 additions
and
35 deletions
Classes/XClass/Form/FormEditorController.php
+
33
−
35
View file @
1d297039
...
...
@@ -69,6 +69,8 @@ class FormEditorController extends \TYPO3\CMS\Form\Controller\FormEditorControll
* @throws \TYPO3\CMS\Core\Cache\Exception\NoSuchCacheException
*/
public
function
saveFormAction
(
string
$formPersistenceIdentifier
,
FormDefinitionArray
$formDefinition
)
{
$registrationService
=
$this
->
objectManager
->
get
(
RegisterService
::
class
);
/** @noinspection PhpInternalEntityUsedInspection */
parent
::
saveFormAction
(
$formPersistenceIdentifier
,
$formDefinition
);
...
...
@@ -79,8 +81,6 @@ class FormEditorController extends \TYPO3\CMS\Form\Controller\FormEditorControll
/** @var array $finishers */
$finishers
=
$formDefinition
[
'finishers'
];
$extensionKey
=
''
;
$templateKey
=
''
;
foreach
(
$finishers
as
$finisher
)
{
...
...
@@ -95,51 +95,49 @@ class FormEditorController extends \TYPO3\CMS\Form\Controller\FormEditorControll
// retrieve the extension and template key and jump out of loop
$extensionKey
=
$finisher
[
'options'
][
'extension'
];
$templateKey
=
$finisher
[
'options'
][
'template'
];
break
;
}
// if no template key was explicitly set, use the form identifier as template key
if
(
$templateKey
===
''
)
{
$templateKey
=
$formDefinition
[
'identifier'
];
}
$templateKey
=
str_replace
(
'_'
,
'-'
,
$finisher
[
'options'
][
'template'
]);
// if
there was no sg mail finisher or an missing key then simply exit the function
if
(
$extensionKey
===
''
||
$templateKey
===
''
)
{
return
;
}
// if
no template key was explicitly set, use the form identifier as template key
if
(
$templateKey
===
''
)
{
$templateKey
=
$formDefinition
[
'identifier'
]
.
'-'
.
$finisher
[
'identifier'
]
;
}
// parse yaml for form fields
$absoluteFilePath
=
GeneralUtility
::
getFileAbsFileName
(
$formPersistenceIdentifier
);
$parsedYaml
=
Yaml
::
parse
(
file_get_contents
(
$absoluteFilePath
));
// if there was no sg mail finisher or an missing key then simply exit the function
if
(
$extensionKey
===
''
||
$templateKey
===
''
)
{
return
;
}
$renderables
=
[];
foreach
(
$parsedYaml
[
'renderables'
]
as
$formPage
)
{
if
(
\is_array
(
$formPage
[
'renderables'
]))
{
foreach
(
$formPage
[
'renderables'
]
as
$row
)
{
if
(
!
\is_array
(
$row
)
||
!
$row
[
'type'
])
{
continue
;
}
// parse yaml for form fields
$absoluteFilePath
=
GeneralUtility
::
getFileAbsFileName
(
$formPersistenceIdentifier
);
$parsedYaml
=
Yaml
::
parse
(
file_get_contents
(
$absoluteFilePath
));
if
(
$row
[
'type'
]
===
'GridRow'
)
{
foreach
(
$row
[
'renderables'
]
as
$renderableInsideGridrow
)
{
$renderables
[]
=
$renderableInsideGridrow
;
$renderables
=
[];
foreach
(
$parsedYaml
[
'renderables'
]
as
$formPage
)
{
if
(
\is_array
(
$formPage
[
'renderables'
]))
{
foreach
(
$formPage
[
'renderables'
]
as
$row
)
{
if
(
!
\is_array
(
$row
)
||
!
$row
[
'type'
])
{
continue
;
}
}
elseif
(
!
\in_array
(
$row
[
'type'
],
self
::
IGNORE_FIELDS
,
TRUE
))
{
$renderables
[]
=
$row
;
if
(
$row
[
'type'
]
===
'GridRow'
)
{
foreach
(
$row
[
'renderables'
]
as
$renderableInsideGridrow
)
{
$renderables
[]
=
$renderableInsideGridrow
;
}
}
elseif
(
!
\in_array
(
$row
[
'type'
],
self
::
IGNORE_FIELDS
,
TRUE
))
{
$renderables
[]
=
$row
;
}
}
}
else
{
return
;
}
}
else
{
return
;
}
// write the new Register.php file and add it to the registrationFiles array in the RegisterService
$this
->
writeRegisterFile
(
$renderables
,
$extensionKey
,
$templateKey
);
}
// call register function in register service class
$registrationService
=
$this
->
objectManager
->
get
(
RegisterService
::
class
);
// write the new Register.php file and add it to the registrationFiles array in the RegisterService
$this
->
writeRegisterFile
(
$renderables
,
$extensionKey
,
$templateKey
);
$registrationService
->
getRegisterArray
();
$this
->
clearCaches
();
...
...
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