Skip to content
Snippets Groups Projects
Commit d42f1586 authored by Markus Klein's avatar Markus Klein Committed by Oliver Bartsch
Browse files

[BUGFIX] Make RichTextElement PHP 8 compatible

RTE yaml configuration can be incomplete/wrong or empty.
Do not access configuration settings without a safeguard.

Resolves: #96383
Releases: main, 11.5
Change-Id: Ie0888402e64a669816edd200d2d54e401e0c399f
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/72702


Reviewed-by: default avatarOliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: default avatarSimon Gilli <typo3@gilbertsoft.org>
Reviewed-by: default avatarOliver Bartsch <bo@cedev.de>
Tested-by: default avatarcore-ci <typo3@b13.com>
Tested-by: default avatarSimon Gilli <typo3@gilbertsoft.org>
Tested-by: default avatarOliver Bartsch <bo@cedev.de>
parent 46bccd1b
Branches
Tags
No related merge requests found
......@@ -161,7 +161,7 @@ class RichTextElement extends AbstractFormElement
$resultArray['html'] = implode(LF, $html);
$this->rteConfiguration = $config['richtextConfiguration']['editor'];
$this->rteConfiguration = $config['richtextConfiguration']['editor'] ?? [];
$resultArray['requireJsModules'][] = $this->loadCkEditorRequireJsModule($fieldId);
return $resultArray;
......@@ -347,7 +347,7 @@ class RichTextElement extends AbstractFormElement
'customConfig' => '',
];
if (is_array($this->rteConfiguration['config'])) {
if (is_array($this->rteConfiguration['config'] ?? null)) {
$configuration = array_replace_recursive($configuration, $this->rteConfiguration['config']);
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment