Commit 0c596db6 authored by Benjamin Franzke's avatar Benjamin Franzke
Browse files

[BUGFIX] Fix sprintf() PHP warning in FinisherOptionGenerator

User supplied strings must not be concatenated into the format
parameter of sprintf() as sequences like %s, or (more likely) %20S
(which is ' S' url escaped) may be contained and cause warnings
because sprintf() expects additional arguments in that case.

Streamline to always use the static '%s: "%s"' format instead.

Releases: main, 11.5, 10.4
Resolves: #96478
Change-Id: Ic3b09c6e1e7c617e78ea405289680bd78d0aab64

Tested-by: core-ci's avatarcore-ci <>
Tested-by: Oliver Bartsch's avatarOliver Bartsch <>
Tested-by: Benni Mack's avatarBenni Mack <>
Tested-by: Benjamin Franzke's avatarBenjamin Franzke <>
Reviewed-by: Andreas Fernandez's avatarAndreas Fernandez <>
Reviewed-by: Oliver Bartsch's avatarOliver Bartsch <>
Reviewed-by: Benni Mack's avatarBenni Mack <>
Reviewed-by: Benjamin Franzke's avatarBenjamin Franzke <>
parent ee4fe560
......@@ -79,13 +79,11 @@ class FinisherOptionGenerator extends AbstractProcessor
$languageService = $this->getLanguageService();
$elementConfiguration['label'] = (string)($elementConfiguration['label'] ?? '');
if (empty($optionValue)) {
$elementConfiguration['label'] .= sprintf(' (%s: "%s")', $languageService->getLL('default'), $languageService->getLL('empty'));
} else {
if (is_array($optionValue)) {
$optionValue = implode(',', $optionValue);
$elementConfiguration['label'] .= sprintf(' (%s: "' . $optionValue . '")', $languageService->getLL('default'));
$optionValue = $languageService->getLL('empty');
} elseif (is_array($optionValue)) {
$optionValue = implode(',', $optionValue);
$elementConfiguration['label'] .= sprintf(' (%s: "%s")', $languageService->getLL('default'), $optionValue);
$sheetElements = $this->converterDto->getResult();
if ($elementConfiguration['section'] ?? false) {
Supports Markdown
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