Commit f4f6afb0 authored by Valentin Despa's avatar Valentin Despa Committed by Wouter Wolters
Browse files

[TASK] Remove second parameter of sL - Part 3/3

Remove the second parameter of sL and replace it
with htmlspecialchars directly in the code.

Resolves: #76325
Related: #71917
Releases: master
Change-Id: I6668eea01d80446a6b6f2ec95435c6e3d93cb0c3
Reviewed-on: https://review.typo3.org/48346

Reviewed-by: Markus Klein's avatarMarkus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein's avatarMarkus Klein <markus.klein@typo3.org>
Reviewed-by: Wouter Wolters's avatarWouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters's avatarWouter Wolters <typo3@wouterwolters.nl>
parent e9489106
......@@ -316,8 +316,8 @@ class Clipboard
. htmlspecialchars($title) . '</a></li>';
// Clear clipboard
$optionArray[] = '<li><a href="' . htmlspecialchars($removeAllUrl) . '#clip_head">' . $languageService->sL('LLL:EXT:lang/locallang_core.xlf:labels.clipboard.clear_clipboard', true) . '</a></li>';
$deleteLink = '<a class="btn btn-danger" href="' . htmlspecialchars($removeAllUrl) . '#clip_head" title="' . $languageService->sL('LLL:EXT:lang/locallang_core.xlf:buttons.clear', true) . '">' . $this->iconFactory->getIcon('actions-document-close', Icon::SIZE_SMALL)->render(SvgIconProvider::MARKUP_IDENTIFIER_INLINE) . '</a>';
$optionArray[] = '<li><a href="' . htmlspecialchars($removeAllUrl) . '#clip_head">' . htmlspecialchars($languageService->sL('LLL:EXT:lang/locallang_core.xlf:labels.clipboard.clear_clipboard')) . '</a></li>';
$deleteLink = '<a class="btn btn-danger" href="' . htmlspecialchars($removeAllUrl) . '#clip_head" title="' . htmlspecialchars($languageService->sL('LLL:EXT:lang/locallang_core.xlf:buttons.clear')) . '">' . $this->iconFactory->getIcon('actions-document-close', Icon::SIZE_SMALL)->render(SvgIconProvider::MARKUP_IDENTIFIER_INLINE) . '</a>';
// menuSelector
$menuSelector = '
......
......@@ -68,8 +68,8 @@ class FlexFormContainerContainer extends AbstractContainer
$moveAndDeleteContent = array();
$userHasAccessToDefaultLanguage = $this->getBackendUserAuthentication()->checkLanguageAccess(0);
if ($userHasAccessToDefaultLanguage) {
$moveAndDeleteContent[] = '<span class="btn btn-default t3js-sortable-handle"><span title="' . $this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:sortable.dragmove', true) . '">' . $iconFactory->getIcon('actions-move-move', Icon::SIZE_SMALL)->render() . '</span></span>';
$moveAndDeleteContent[] = '<span class="btn btn-default t3js-delete"><span title="' . $this->getLanguageService()->sL('LLL:EXT:lang/locallang_common.xlf:delete', true) . '">' . $iconFactory->getIcon('actions-edit-delete', Icon::SIZE_SMALL)->render() . '</span></span>';
$moveAndDeleteContent[] = '<span class="btn btn-default t3js-sortable-handle"><span title="' . htmlspecialchars($this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:sortable.dragmove')) . '">' . $iconFactory->getIcon('actions-move-move', Icon::SIZE_SMALL)->render() . '</span></span>';
$moveAndDeleteContent[] = '<span class="btn btn-default t3js-delete"><span title="' . htmlspecialchars($this->getLanguageService()->sL('LLL:EXT:lang/locallang_common.xlf:delete')) . '">' . $iconFactory->getIcon('actions-edit-delete', Icon::SIZE_SMALL)->render() . '</span></span>';
}
$options = $this->data;
......
......@@ -166,7 +166,7 @@ class FlexFormSectionContainer extends AbstractContainer
}
// Wrap child stuff
$toggleAll = $languageService->sL('LLL:EXT:lang/locallang_core.xlf:labels.toggleall', true);
$toggleAll = htmlspecialchars($languageService->sL('LLL:EXT:lang/locallang_core.xlf:labels.toggleall'));
$html = array();
$html[] = '<div class="panel panel-tab">';
$html[] = '<div class="panel-body">';
......
......@@ -351,7 +351,7 @@ class InlineControlContainer extends AbstractContainer
$attributes = array();
switch ($type) {
case 'newRecord':
$title = $languageService->sL('LLL:EXT:lang/locallang_core.xlf:cm.createnew', true);
$title = htmlspecialchars($languageService->sL('LLL:EXT:lang/locallang_core.xlf:cm.createnew'));
$icon = 'actions-document-new';
$className = 'typo3-newRecordLink';
$attributes['class'] = 'btn btn-default inlineNewButton ' . $this->inlineData['config'][$nameObject]['md5'];
......@@ -360,23 +360,23 @@ class InlineControlContainer extends AbstractContainer
$attributes['style'] = $conf['inline']['inlineNewButtonStyle'];
}
if (!empty($conf['appearance']['newRecordLinkAddTitle'])) {
$title = sprintf(
$languageService->sL('LLL:EXT:lang/locallang_core.xlf:cm.createnew.link', true),
$languageService->sL($GLOBALS['TCA'][$conf['foreign_table']]['ctrl']['title'], true)
);
$title = htmlspecialchars(sprintf(
$languageService->sL('LLL:EXT:lang/locallang_core.xlf:cm.createnew.link'),
$languageService->sL($GLOBALS['TCA'][$conf['foreign_table']]['ctrl']['title'])
));
} elseif (isset($conf['appearance']['newRecordLinkTitle']) && $conf['appearance']['newRecordLinkTitle'] !== '') {
$title = $languageService->sL($conf['appearance']['newRecordLinkTitle'], true);
$title = htmlspecialchars($languageService->sL($conf['appearance']['newRecordLinkTitle']));
}
break;
case 'localize':
$title = $languageService->sL('LLL:EXT:lang/locallang_misc.xlf:localizeAllRecords', true);
$title = htmlspecialchars($languageService->sL('LLL:EXT:lang/locallang_misc.xlf:localizeAllRecords'));
$icon = 'actions-document-localize';
$className = 'typo3-localizationLink';
$attributes['class'] = 'btn btn-default';
$attributes['onclick'] = 'return inline.synchronizeLocalizeRecords(' . GeneralUtility::quoteJSvalue($objectPrefix) . ', \'localize\')';
break;
case 'synchronize':
$title = $languageService->sL('LLL:EXT:lang/locallang_misc.xlf:synchronizeWithOriginalLanguage', true);
$title = htmlspecialchars($languageService->sL('LLL:EXT:lang/locallang_misc.xlf:synchronizeWithOriginalLanguage'));
$icon = 'actions-document-synchronize';
$className = 'typo3-synchronizationLink';
$attributes['class'] = 'btn btn-default inlineNewButton ' . $this->inlineData['config'][$nameObject]['md5'];
......@@ -433,9 +433,9 @@ class InlineControlContainer extends AbstractContainer
$mode = 'db';
$showUpload = false;
if (!empty($inlineConfiguration['appearance']['createNewRelationLinkTitle'])) {
$createNewRelationText = $languageService->sL($inlineConfiguration['appearance']['createNewRelationLinkTitle'], true);
$createNewRelationText = htmlspecialchars($languageService->sL($inlineConfiguration['appearance']['createNewRelationLinkTitle']));
} else {
$createNewRelationText = $languageService->sL('LLL:EXT:lang/locallang_core.xlf:cm.createNewRelation', true);
$createNewRelationText = htmlspecialchars($languageService->sL('LLL:EXT:lang/locallang_core.xlf:cm.createNewRelation'));
}
if (is_array($groupFieldConfiguration['appearance'])) {
if (isset($groupFieldConfiguration['appearance']['elementBrowserType'])) {
......@@ -492,7 +492,7 @@ class InlineControlContainer extends AbstractContainer
data-max-file-size="' . htmlspecialchars($maxFileSize) . '"
>';
$item .= $this->iconFactory->getIcon('actions-upload', Icon::SIZE_SMALL)->render() . ' ';
$item .= $languageService->sL('LLL:EXT:lang/locallang_core.xlf:file_upload.select-and-submit', true);
$item .= htmlspecialchars($languageService->sL('LLL:EXT:lang/locallang_core.xlf:file_upload.select-and-submit'));
$item .= '</a>';
$this->requireJsModules[] = ['TYPO3/CMS/Backend/DragUploader' => 'function(dragUploader){dragUploader.initialize()}'];
......@@ -502,9 +502,9 @@ class InlineControlContainer extends AbstractContainer
$buttonStyle = ' style="' . $inlineConfiguration['inline']['inlineOnlineMediaAddButtonStyle'] . '"';
}
$this->requireJsModules[] = 'TYPO3/CMS/Backend/OnlineMedia';
$buttonText = $languageService->sL('LLL:EXT:lang/locallang_core.xlf:online_media.new_media.button', true);
$placeholder = $languageService->sL('LLL:EXT:lang/locallang_core.xlf:online_media.new_media.placeholder', true);
$buttonSubmit = $languageService->sL('LLL:EXT:lang/locallang_core.xlf:online_media.new_media.submit', true);
$buttonText = htmlspecialchars($languageService->sL('LLL:EXT:lang/locallang_core.xlf:online_media.new_media.button'));
$placeholder = htmlspecialchars($languageService->sL('LLL:EXT:lang/locallang_core.xlf:online_media.new_media.placeholder'));
$buttonSubmit = htmlspecialchars($languageService->sL('LLL:EXT:lang/locallang_core.xlf:online_media.new_media.submit'));
$item .= '
<span class="btn btn-default t3js-online-media-add-btn ' . $this->inlineData['config'][$nameObject]['md5'] . '"
' . $buttonStyle . '
......@@ -523,7 +523,7 @@ class InlineControlContainer extends AbstractContainer
$item = '<div class="form-control-wrap">' . $item . '</div>';
$allowedList = '';
$allowedLabel = $languageService->sL('LLL:EXT:lang/locallang_core.xlf:cm.allowedFileExtensions', true);
$allowedLabel = htmlspecialchars($languageService->sL('LLL:EXT:lang/locallang_core.xlf:cm.allowedFileExtensions'));
foreach ($allowedArray as $allowedItem) {
$allowedList .= '<span class="label label-success">' . strtoupper($allowedItem) . '</span> ';
}
......@@ -569,9 +569,9 @@ class InlineControlContainer extends AbstractContainer
// there is only one record item in the select-box, that is selected by default
// The selector-box creates a new relation on using an onChange event (see some line above)
if (!empty($config['appearance']['createNewRelationLinkTitle'])) {
$createNewRelationText = $this->getLanguageService()->sL($config['appearance']['createNewRelationLinkTitle'], true);
$createNewRelationText = htmlspecialchars($this->getLanguageService()->sL($config['appearance']['createNewRelationLinkTitle']));
} else {
$createNewRelationText = $this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:cm.createNewRelation', true);
$createNewRelationText = htmlspecialchars($this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:cm.createNewRelation'));
}
$item .= '
<span class="input-group-btn">
......
......@@ -305,7 +305,7 @@ class InlineRecordContainer extends AbstractContainer
$recordTitle = $data['recordTitle'];
if (empty($recordTitle)) {
$recordTitle = '<em>[' . $languageService->sL('LLL:EXT:lang/locallang_core.xlf:labels.no_title', true) . ']</em>';
$recordTitle = '<em>[' . htmlspecialchars($languageService->sL('LLL:EXT:lang/locallang_core.xlf:labels.no_title')) . ']</em>';
}
$altText = BackendUtility::getRecordIconAltText($rec, $foreignTable);
......@@ -409,7 +409,7 @@ class InlineRecordContainer extends AbstractContainer
$hookObj->renderForeignRecordHeaderControl_preProcess($data['inlineParentUid'], $foreignTable, $rec, $inlineConfig, $data['isInlineDefaultLanguageRecordInLocalizedParentContext'], $enabledControls);
}
if ($data['isInlineDefaultLanguageRecordInLocalizedParentContext']) {
$cells['localize.isLocalizable'] = '<span title="' . $languageService->sL('LLL:EXT:lang/locallang_misc.xlf:localize.isLocalizable', true) . '">'
$cells['localize.isLocalizable'] = '<span title="' . htmlspecialchars($languageService->sL('LLL:EXT:lang/locallang_misc.xlf:localize.isLocalizable')) . '">'
. $this->iconFactory->getIcon('actions-edit-localize-status-low', Icon::SIZE_SMALL)->render()
. '</span>';
}
......@@ -423,7 +423,7 @@ class InlineRecordContainer extends AbstractContainer
$table = $foreignTable;
}
$cells['info'] = '
<a class="btn btn-default" href="#" onclick="' . htmlspecialchars(('top.launchView(' . GeneralUtility::quoteJSvalue($table) . ', ' . GeneralUtility::quoteJSvalue($uid) . '); return false;')) . '" title="' . $languageService->sL('LLL:EXT:lang/locallang_mod_web_list.xlf:showInfo', true) . '">
<a class="btn btn-default" href="#" onclick="' . htmlspecialchars(('top.launchView(' . GeneralUtility::quoteJSvalue($table) . ', ' . GeneralUtility::quoteJSvalue($uid) . '); return false;')) . '" title="' . htmlspecialchars($languageService->sL('LLL:EXT:lang/locallang_mod_web_list.xlf:showInfo')) . '">
' . $this->iconFactory->getIcon('actions-document-info', Icon::SIZE_SMALL)->render() . '
</a>';
}
......@@ -438,7 +438,7 @@ class InlineRecordContainer extends AbstractContainer
$style = ' style="' . $inlineConfig['inline']['inlineNewButtonStyle'] . '"';
}
$cells['new'] = '
<a class="btn btn-default inlineNewButton ' . $this->inlineData['config'][$nameObject]['md5'] . '" href="#" onclick="' . htmlspecialchars($onClick) . '" title="' . $languageService->sL(('LLL:EXT:lang/locallang_mod_web_list.xlf:new' . ($isPagesTable ? 'Page' : 'Record')), true) . '" ' . $style . '>
<a class="btn btn-default inlineNewButton ' . $this->inlineData['config'][$nameObject]['md5'] . '" href="#" onclick="' . htmlspecialchars($onClick) . '" title="' . htmlspecialchars($languageService->sL(('LLL:EXT:lang/locallang_mod_web_list.xlf:new' . ($isPagesTable ? 'Page' : 'Record')))) . '" ' . $style . '>
' . $this->iconFactory->getIcon('actions-' . ($isPagesTable ? 'page' : 'document') . '-new', Icon::SIZE_SMALL)->render() . '
</a>';
}
......@@ -449,14 +449,14 @@ class InlineRecordContainer extends AbstractContainer
$onClick = 'return inline.changeSorting(' . GeneralUtility::quoteJSvalue($nameObjectFtId) . ', \'1\')';
$style = $inlineConfig['inline']['first'] == $rec['uid'] ? 'style="visibility: hidden;"' : '';
$cells['sort.up'] = '
<a class="btn btn-default sortingUp" href="#" onclick="' . htmlspecialchars($onClick) . '" ' . $style . ' title="' . $languageService->sL('LLL:EXT:lang/locallang_mod_web_list.xlf:moveUp', true) . '">
<a class="btn btn-default sortingUp" href="#" onclick="' . htmlspecialchars($onClick) . '" ' . $style . ' title="' . htmlspecialchars($languageService->sL('LLL:EXT:lang/locallang_mod_web_list.xlf:moveUp')) . '">
' . $this->iconFactory->getIcon('actions-move-up', Icon::SIZE_SMALL)->render() . '
</a>';
// Down
$onClick = 'return inline.changeSorting(' . GeneralUtility::quoteJSvalue($nameObjectFtId) . ', \'-1\')';
$style = $inlineConfig['inline']['last'] == $rec['uid'] ? 'style="visibility: hidden;"' : '';
$cells['sort.down'] = '
<a class="btn btn-default sortingDown" href="#" onclick="' . htmlspecialchars($onClick) . '" ' . $style . ' title="' . $languageService->sL('LLL:EXT:lang/locallang_mod_web_list.xlf:moveDown', true) . '">
<a class="btn btn-default sortingDown" href="#" onclick="' . htmlspecialchars($onClick) . '" ' . $style . ' title="' . htmlspecialchars($languageService->sL('LLL:EXT:lang/locallang_mod_web_list.xlf:moveDown')) . '">
' . $this->iconFactory->getIcon('actions-move-down', Icon::SIZE_SMALL)->render() . '
</a>';
}
......@@ -493,7 +493,7 @@ class InlineRecordContainer extends AbstractContainer
|| !$isPagesTable && $calcPerms & Permission::CONTENT_EDIT
|| $isSysFileReferenceTable && $calcPerms & Permission::PAGE_EDIT)
) {
$title = $languageService->sL('LLL:EXT:lang/locallang_mod_web_list.xlf:delete', true);
$title = htmlspecialchars($languageService->sL('LLL:EXT:lang/locallang_mod_web_list.xlf:delete'));
$icon = $this->iconFactory->getIcon('actions-edit-delete', Icon::SIZE_SMALL)->render();
$cells['delete'] = '<a href="#" class="btn btn-default t3js-editform-delete-inline-record" data-objectid="' . htmlspecialchars($nameObjectFtId) . '" title="' . $title . '">' . $icon . '</a>';
}
......@@ -505,14 +505,14 @@ class InlineRecordContainer extends AbstractContainer
GeneralUtility::quoteJSvalue($hiddenField) .')';
$className = 't3js-' . $nameObjectFtId . '_disabled';
if ($rec[$hiddenField]) {
$title = $languageService->sL(('LLL:EXT:lang/locallang_mod_web_list.xlf:unHide' . ($isPagesTable ? 'Page' : '')), true);
$title = htmlspecialchars($languageService->sL(('LLL:EXT:lang/locallang_mod_web_list.xlf:unHide' . ($isPagesTable ? 'Page' : ''))));
$cells['hide.unhide'] = '
<a class="btn btn-default hiddenHandle ' . $className . '" href="#" onclick="'
. htmlspecialchars($onClick) . '"' . 'title="' . $title . '">' .
$this->iconFactory->getIcon('actions-edit-unhide', Icon::SIZE_SMALL)->render() . '
</a>';
} else {
$title = $languageService->sL(('LLL:EXT:lang/locallang_mod_web_list.xlf:hide' . ($isPagesTable ? 'Page' : '')), true);
$title = htmlspecialchars($languageService->sL(('LLL:EXT:lang/locallang_mod_web_list.xlf:hide' . ($isPagesTable ? 'Page' : ''))));
$cells['hide.hide'] = '
<a class="btn btn-default hiddenHandle ' . $className . '" href="#" onclick="'
. htmlspecialchars($onClick) . '"' . 'title="' . $title . '">' .
......@@ -523,7 +523,7 @@ class InlineRecordContainer extends AbstractContainer
// Drag&Drop Sorting: Sortable handler for script.aculo.us
if ($enabledControls['dragdrop'] && $permsEdit && $enableManualSorting && $inlineConfig['appearance']['useSortable']) {
$additionalCells['dragdrop'] = '
<span class="btn btn-default sortableHandle" data-id="' . htmlspecialchars($rec['uid']) . '" title="' . $languageService->sL('LLL:EXT:lang/locallang_core.xlf:labels.move', true) . '">
<span class="btn btn-default sortableHandle" data-id="' . htmlspecialchars($rec['uid']) . '" title="' . htmlspecialchars($languageService->sL('LLL:EXT:lang/locallang_core.xlf:labels.move')) . '">
' . $this->iconFactory->getIcon('actions-move-move', Icon::SIZE_SMALL)->render() . '
</span>';
}
......@@ -531,7 +531,7 @@ class InlineRecordContainer extends AbstractContainer
if ($enabledControls['localize'] && $data['isInlineDefaultLanguageRecordInLocalizedParentContext']) {
$onClick = 'inline.synchronizeLocalizeRecords(' . GeneralUtility::quoteJSvalue($nameObjectFt) . ', ' . GeneralUtility::quoteJSvalue($rec['uid']) . ');';
$cells['localize'] = '
<a class="btn btn-default" href="#" onclick="' . htmlspecialchars($onClick) . '" title="' . $languageService->sL('LLL:EXT:lang/locallang_misc.xlf:localize', true) . '">
<a class="btn btn-default" href="#" onclick="' . htmlspecialchars($onClick) . '" title="' . htmlspecialchars($languageService->sL('LLL:EXT:lang/locallang_misc.xlf:localize')) . '">
' . $this->iconFactory->getIcon('actions-document-localize', Icon::SIZE_SMALL)->render() . '
</a>';
}
......
......@@ -69,18 +69,18 @@ class OuterWrapContainer extends AbstractContainer
$tableTitle = $languageService->sL($this->data['processedTca']['ctrl']['title']);
if ($this->data['command'] === 'new') {
$newOrUid = ' <span class="typo3-TCEforms-newToken">' . $languageService->sL('LLL:EXT:lang/locallang_core.xlf:labels.new', true) . '</span>';
$newOrUid = ' <span class="typo3-TCEforms-newToken">' . htmlspecialchars($languageService->sL('LLL:EXT:lang/locallang_core.xlf:labels.new')) . '</span>';
// @todo: There is quite some stuff do to for WS overlays ...
$workspacedPageRecord = BackendUtility::getRecordWSOL('pages', $this->data['effectivePid'], 'title');
$pageTitle = BackendUtility::getRecordTitle('pages', $workspacedPageRecord, true, false);
if ($table === 'pages') {
$label = $languageService->sL('LLL:EXT:lang/locallang_core.xlf:labels.createNewPage', true);
$label = htmlspecialchars($languageService->sL('LLL:EXT:lang/locallang_core.xlf:labels.createNewPage'));
$pageTitle = sprintf($label, $tableTitle);
} else {
$label = $languageService->sL('LLL:EXT:lang/locallang_core.xlf:labels.createNewRecord', true);
$label = htmlspecialchars($languageService->sL('LLL:EXT:lang/locallang_core.xlf:labels.createNewRecord'));
if ($this->data['effectivePid'] === 0) {
$label = $languageService->sL('LLL:EXT:lang/locallang_core.xlf:labels.createNewRecordRootLevel', true);
$label = htmlspecialchars($languageService->sL('LLL:EXT:lang/locallang_core.xlf:labels.createNewRecordRootLevel'));
}
$pageTitle = sprintf($label, $tableTitle, $pageTitle);
}
......@@ -91,17 +91,17 @@ class OuterWrapContainer extends AbstractContainer
// @todo: getRecordTitlePrep applies an htmlspecialchars here
$recordLabel = BackendUtility::getRecordTitlePrep($this->data['recordTitle']);
if ($table === 'pages') {
$label = $languageService->sL('LLL:EXT:lang/locallang_core.xlf:labels.editPage', true);
$label = htmlspecialchars($languageService->sL('LLL:EXT:lang/locallang_core.xlf:labels.editPage'));
$pageTitle = sprintf($label, $tableTitle, $recordLabel);
} else {
$label = $languageService->sL('LLL:EXT:lang/locallang_core.xlf:labels.editRecord', true);
$label = htmlspecialchars($languageService->sL('LLL:EXT:lang/locallang_core.xlf:labels.editRecord'));
$workspacedPageRecord = BackendUtility::getRecordWSOL('pages', $row['pid'], 'uid,title');
$pageTitle = BackendUtility::getRecordTitle('pages', $workspacedPageRecord, true, false);
if (empty($recordLabel)) {
$label = $languageService->sL('LLL:EXT:lang/locallang_core.xlf:labels.editRecordNoTitle', true);
$label = htmlspecialchars($languageService->sL('LLL:EXT:lang/locallang_core.xlf:labels.editRecordNoTitle'));
}
if ($this->data['effectivePid'] === 0) {
$label = $languageService->sL('LLL:EXT:lang/locallang_core.xlf:labels.editRecordRootLevel', true);
$label = htmlspecialchars($languageService->sL('LLL:EXT:lang/locallang_core.xlf:labels.editRecordRootLevel'));
}
if (!empty($recordLabel)) {
// Use record title and prepend an edit label.
......
......@@ -341,7 +341,7 @@ class SingleFieldContainer extends AbstractContainer
/** @var IconFactory $iconFactory */
$iconFactory = GeneralUtility::makeInstance(IconFactory::class);
if ($defaultLanguageValue !== '') {
$item .= '<div class="t3-form-original-language" title="' . $this->getLanguageService()->sL('LLL:EXT:lang/locallang_misc.xlf:localizeMergeIfNotBlank', true) . '">'
$item .= '<div class="t3-form-original-language" title="' . htmlspecialchars($this->getLanguageService()->sL('LLL:EXT:lang/locallang_misc.xlf:localizeMergeIfNotBlank')) . '">'
. $iconFactory->getIcon($this->data['systemLanguageRows'][0]['flagIconIdentifier'], Icon::SIZE_SMALL)->render()
. $this->getMergeBehaviourIcon($fieldConfig['l10n_mode'])
. $this->previewFieldValue($defaultLanguageValue, $fieldConfig, $field) . '</div>';
......@@ -356,7 +356,7 @@ class SingleFieldContainer extends AbstractContainer
true
);
if ($defaultLanguageValue !== '') {
$item .= '<div class="t3-form-original-language" title="' . $this->getLanguageService()->sL('LLL:EXT:lang/locallang_misc.xlf:localizeMergeIfNotBlank', true) . '">'
$item .= '<div class="t3-form-original-language" title="' . htmlspecialchars($this->getLanguageService()->sL('LLL:EXT:lang/locallang_misc.xlf:localizeMergeIfNotBlank')) . '">'
. $iconFactory->getIcon($this->data['systemLanguageRows'][$previewLanguage['sys_language_uid']]['flagIconIdentifier'], Icon::SIZE_SMALL)->render()
. $this->getMergeBehaviourIcon($fieldConfig['l10n_mode'])
. $this->previewFieldValue($defaultLanguageValue, $fieldConfig, $field) . '</div>';
......
......@@ -95,7 +95,7 @@ class ImageManipulationElement extends AbstractFormElement
// Check if ratio labels hold translation strings
foreach ((array)$config['ratios'] as $ratio => $label) {
$config['ratios'][$ratio] = $languageService->sL($label, true);
$config['ratios'][$ratio] = htmlspecialchars($languageService->sL($label));
}
$formFieldId = StringUtility::getUniqueId('formengine-image-manipulation-');
......@@ -122,7 +122,7 @@ class ImageManipulationElement extends AbstractFormElement
$button .= ' ' . $key . '="' . htmlspecialchars($value) . '"';
}
$button .= '><span class="t3-icon fa fa-crop"></span>';
$button .= $languageService->sL('LLL:EXT:lang/locallang_wizards.xlf:imwizard.open-editor', true);
$button .= htmlspecialchars($languageService->sL('LLL:EXT:lang/locallang_wizards.xlf:imwizard.open-editor'));
$button .= '</button>';
$inputField = '<input type="hidden" '
......@@ -139,7 +139,7 @@ class ImageManipulationElement extends AbstractFormElement
);
}
$content .= '<p class="text-muted"><em>' . $languageService->sL('LLL:EXT:lang/locallang_wizards.xlf:imwizard.supported-types-message', true) . '<br />';
$content .= '<p class="text-muted"><em>' . htmlspecialchars($languageService->sL('LLL:EXT:lang/locallang_wizards.xlf:imwizard.supported-types-message')) . '<br />';
$content .= mb_strtoupper(implode(', ', GeneralUtility::trimExplode(',', $config['allowedExtensions'])));
$content .= '</em></p>';
......@@ -245,13 +245,13 @@ class ImageManipulationElement extends AbstractFormElement
$content .= '<div class="table-fit-block table-spacer-wrap">';
$content .= '<table class="table table-no-borders t3js-image-manipulation-info' . ($imageManipulation === null ? ' hide' : '') . '">';
$content .= '<tr><td>' . $languageService->sL('LLL:EXT:lang/locallang_wizards.xlf:imwizard.crop-x', true) . '</td>';
$content .= '<tr><td>' . htmlspecialchars($languageService->sL('LLL:EXT:lang/locallang_wizards.xlf:imwizard.crop-x')) . '</td>';
$content .= '<td class="t3js-image-manipulation-info-crop-x">' . $x . 'px</td></tr>';
$content .= '<tr><td>' . $languageService->sL('LLL:EXT:lang/locallang_wizards.xlf:imwizard.crop-y', true) . '</td>';
$content .= '<tr><td>' . htmlspecialchars($languageService->sL('LLL:EXT:lang/locallang_wizards.xlf:imwizard.crop-y')) . '</td>';
$content .= '<td class="t3js-image-manipulation-info-crop-y">' . $y . 'px</td></tr>';
$content .= '<tr><td>' . $languageService->sL('LLL:EXT:lang/locallang_wizards.xlf:imwizard.crop-width', true) . '</td>';
$content .= '<tr><td>' . htmlspecialchars($languageService->sL('LLL:EXT:lang/locallang_wizards.xlf:imwizard.crop-width')) . '</td>';
$content .= '<td class="t3js-image-manipulation-info-crop-width">' . $width . 'px</td></tr>';
$content .= '<tr><td>' . $languageService->sL('LLL:EXT:lang/locallang_wizards.xlf:imwizard.crop-height', true) . '</td>';
$content .= '<tr><td>' . htmlspecialchars($languageService->sL('LLL:EXT:lang/locallang_wizards.xlf:imwizard.crop-height')) . '</td>';
$content .= '<td class="t3js-image-manipulation-info-crop-height">' . $height . 'px</td></tr>';
$content .= '</table>';
$content .= '</div>';
......
......@@ -156,7 +156,7 @@ class SelectCheckBoxElement extends AbstractFormElement
$resetGroupBtn = '';
if (!empty($resetGroup)) {
$resetGroup[] = 'TYPO3.FormEngine.updateCheckboxState(this);';
$title = $this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:labels.revertSelection', true);
$title = htmlspecialchars($this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:labels.revertSelection'));
$resetGroupBtn = '<a href="#" '
. 'class="btn btn-default btn-sm" '
. 'onclick="' . implode('', $resetGroup) . ' return false;" '
......
......@@ -87,7 +87,7 @@ class SelectSingleBoxElement extends AbstractFormElement
'</div>',
'</div>',
'<p>',
'<em>' . $this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:labels.holdDownCTRL', true) . '</em>',
'<em>' . htmlspecialchars($this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:labels.holdDownCTRL')) . '</em>',
'</p>',
]);
$html = implode(LF, $html);
......
......@@ -83,7 +83,7 @@ class SuggestWizard
<div class="input-group">
<span class="input-group-addon">' . $iconFactory->getIcon('actions-search', Icon::SIZE_SMALL)->render() . '</span>
<input type="search" class="t3-form-suggest form-control"
placeholder="' . $languageService->sL('LLL:EXT:lang/locallang_core.xlf:labels.findRecord', true) . '"
placeholder="' . htmlspecialchars($languageService->sL('LLL:EXT:lang/locallang_core.xlf:labels.findRecord')) . '"
data-fieldname="' . htmlspecialchars($fieldname) . '"
data-table="' . htmlspecialchars($table) . '"
data-field="' . htmlspecialchars($field) . '"
......
......@@ -459,7 +459,7 @@ class RecordHistory
// Re-write field names with labels
$tmpFieldList = explode(',', $entry['fieldlist']);
foreach ($tmpFieldList as $key => $value) {
$tmp = str_replace(':', '', $languageService->sL(BackendUtility::getItemLabel($entry['tablename'], $value), true));
$tmp = str_replace(':', '', htmlspecialchars($languageService->sL(BackendUtility::getItemLabel($entry['tablename'], $value))));
if ($tmp) {
$tmpFieldList[$key] = $tmp;
} else {
......@@ -563,7 +563,7 @@ class RecordHistory
);
$lines[] = array(
'title' => ($rollbackUid ? $this->createRollbackLink(($table . ':' . $rollbackUid . ':' . $fN), htmlspecialchars($languageService->getLL('revertField')), 2) : '') . '
' . $languageService->sL(BackendUtility::getItemLabel($table, $fN), true),
' . htmlspecialchars($languageService->sL(BackendUtility::getItemLabel($table, $fN))),
'result' => str_replace('\n', PHP_EOL, str_replace('\r\n', '\n', $diffres))
);
}
......
......@@ -175,7 +175,7 @@ class Commands
$data['pages'][$placeholder]['pid'] = $pid;
$data['pages'][$placeholder]['doktype'] = $pageType;
$data['pages'][$placeholder]['title'] = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:tree.defaultPageTitle', true);
$data['pages'][$placeholder]['title'] = htmlspecialchars($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:tree.defaultPageTitle'));
$newPageId = self::processTceCmdAndDataMap(array(), $data);
$node = self::getNode($newPageId[$placeholder]);
if ($pid !== $targetId) {
......@@ -327,7 +327,7 @@ class Commands
$text = $record['nav_title'];
}
if (trim($text) === '') {
$visibleText = '[' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:labels.no_title', true) . ']';
$visibleText = '[' . htmlspecialchars($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:labels.no_title')) . ']';
} else {
$visibleText = $text;
}
......
......@@ -141,7 +141,7 @@ class ExtdirectTreeDataProvider extends \TYPO3\CMS\Backend\Tree\AbstractExtJsTre
if (!$isAdmin && !in_array($doktype, $allowedDoktypes)) {
continue;
}
$label = $GLOBALS['LANG']->sL($doktypeLabelMap[$doktype], true);
$label = htmlspecialchars($GLOBALS['LANG']->sL($doktypeLabelMap[$doktype]));
$icon = $this->iconFactory->getIcon($GLOBALS['TCA']['pages']['ctrl']['typeicon_classes'][$doktype], Icon::SIZE_SMALL)->render();
$output[] = array(
'nodeType' => $doktype,
......@@ -182,20 +182,20 @@ class ExtdirectTreeDataProvider extends \TYPO3\CMS\Backend\Tree\AbstractExtJsTre
$indicators = $this->getIndicators();
$configuration = array(
'LLL' => array(
'copyHint' => $GLOBALS['LANG']->sL($file . 'tree.copyHint', true),
'fakeNodeHint' => $GLOBALS['LANG']->sL($file . 'mess.please_wait', true),
'activeFilterMode' => $GLOBALS['LANG']->sL($file . 'tree.activeFilterMode', true),
'dropToRemove' => $GLOBALS['LANG']->sL($file . 'tree.dropToRemove', true),
'buttonRefresh' => $GLOBALS['LANG']->sL($file . 'labels.refresh', true),
'buttonNewNode' => $GLOBALS['LANG']->sL($file . 'tree.buttonNewNode', true),
'buttonFilter' => $GLOBALS['LANG']->sL($file . 'tree.buttonFilter', true),
'dropZoneElementRemoved' => $GLOBALS['LANG']->sL($file . 'tree.dropZoneElementRemoved', true),
'dropZoneElementRestored' => $GLOBALS['LANG']->sL($file . 'tree.dropZoneElementRestored', true),
'searchTermInfo' => $GLOBALS['LANG']->sL($file . 'tree.searchTermInfo', true),
'temporaryMountPointIndicatorInfo' => $GLOBALS['LANG']->sL($file . 'labels.temporaryDBmount', true),
'deleteDialogTitle' => $GLOBALS['LANG']->sL('LLL:EXT:backend/Resources/Private/Language/locallang_layout.xlf:deleteItem', true),
'deleteDialogMessage' => $GLOBALS['LANG']->sL('LLL:EXT:backend/Resources/Private/Language/locallang_layout.xlf:deleteWarning', true),
'recursiveDeleteDialogMessage' => $GLOBALS['LANG']->sL('LLL:EXT:backend/Resources/Private/Language/locallang_layout.xlf:recursiveDeleteWarning', true)
'copyHint' => htmlspecialchars($GLOBALS['LANG']->sL($file . 'tree.copyHint')),
'fakeNodeHint' => htmlspecialchars($GLOBALS['LANG']->sL($file . 'mess.please_wait')),
'activeFilterMode' => htmlspecialchars($GLOBALS['LANG']->sL($file . 'tree.activeFilterMode')),
'dropToRemove' => htmlspecialchars($GLOBALS['LANG']->sL($file . 'tree.dropToRemove')),
'buttonRefresh' => htmlspecialchars($GLOBALS['LANG']->sL($file . 'labels.refresh')),
'buttonNewNode' => htmlspecialchars($GLOBALS['LANG']->sL($file . 'tree.buttonNewNode')),
'buttonFilter' => htmlspecialchars($GLOBALS['LANG']->sL($file . 'tree.buttonFilter')),
'dropZoneElementRemoved' => htmlspecialchars($GLOBALS['LANG']->sL($file . 'tree.dropZoneElementRemoved')),
'dropZoneElementRestored' => htmlspecialchars($GLOBALS['LANG']->sL($file . 'tree.dropZoneElementRestored')),
'searchTermInfo' => htmlspecialchars($GLOBALS['LANG']->sL($file . 'tree.searchTermInfo')),
'temporaryMountPointIndicatorInfo' => htmlspecialchars($GLOBALS['LANG']->sL($file . 'labels.temporaryDBmount')),
'deleteDialogTitle' => htmlspecialchars($GLOBALS['LANG']->sL('LLL:EXT:backend/Resources/Private/Language/locallang_layout.xlf:deleteItem')),
'deleteDialogMessage' => htmlspecialchars($GLOBALS['LANG']->sL('LLL:EXT:backend/Resources/Private/Language/locallang_layout.xlf:deleteWarning')),
'recursiveDeleteDialogMessage' => htmlspecialchars($GLOBALS['LANG']->sL('LLL:EXT:backend/Resources/Private/Language/locallang_layout.xlf:recursiveDeleteWarning'))
),
'Configuration' => array(
'hideFilter' => $GLOBALS['BE_USER']->getTSConfigVal('options.pageTree.hideFilter'),
......
......@@ -685,7 +685,7 @@ abstract class AbstractTreeView
public function getTitleStr($row, $titleLen = 30)
{
$title = htmlspecialchars(GeneralUtility::fixed_lgd_cs($row['title'], $titleLen));
$title = trim($row['title']) === '' ? '<em>[' . $this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:labels.no_title', true) . ']</em>' : $title;
$title = trim($row['title']) === '' ? '<em>[' . htmlspecialchars($this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:labels.no_title')) . ']</em>' : $title;
return $title;
}
......
......@@ -412,7 +412,7 @@ class PagePositionMap
$head = '';
foreach ($tcaItems as $item) {
if ($item[1] == $columnKey) {
$head = $this->getLanguageService()->sL($item[0], true);
$head = htmlspecialchars($this->getLanguageService()->sL($item[0]));
}
}
// Render the grid cell
......@@ -451,7 +451,7 @@ class PagePositionMap
$row = '';
foreach ($colPosArray as $kk => $vv) {
$row .= '<td class="col-nowrap col-min" width="' . round(100 / $count) . '%">';
$row .= '<p><strong>' . $this->wrapColumnHeader($this->getLanguageService()->sL(BackendUtility::getLabelFromItemlist('tt_content', 'colPos', $vv), true), $vv) . '</strong></p>';
$row .= '<p><strong>' . $this->wrapColumnHeader(htmlspecialchars($this->getLanguageService()->sL(BackendUtility::getLabelFromItemlist('tt_content', 'colPos', $vv))), $vv) . '</strong></p>';
if (!empty($lines[$vv])) {
$row .= '<ul class="list-unstyled">';
foreach ($lines[$vv] as $line) {
......
......@@ -126,7 +126,7 @@ class PageTreeView extends AbstractTreeView
{
$lang = $this->getLanguageService();
if ($this->ext_showNavTitle && isset($row['nav_title']) && trim($row['nav_title']) !== '') {
$title = '<span title="' . $lang->sL('LLL:EXT:lang/locallang_tca.xlf:title', true) . ' '
$title = '<span title="' . htmlspecialchars($lang->sL('LLL:EXT:lang/locallang_tca.xlf:title')) . ' '
. htmlspecialchars(trim($row['title'])) . '">'
. htmlspecialchars(GeneralUtility::fixed_lgd_cs($row['nav_title'], $titleLen))
. '</span>';
......@@ -134,12 +134,12 @@ class PageTreeView extends AbstractTreeView
$title = htmlspecialchars(GeneralUtility::fixed_lgd_cs($row['title'], $titleLen));
if (isset($row['nav_title']) && trim($row['nav_title']) !== '') {
$title = '<span title="'
. $lang->sL('LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.nav_title', true)
. htmlspecialchars($lang->sL('LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.nav_title'))
. ' ' . htmlspecialchars(trim($row['nav_title'])) . '">' . $title
. '</span>';
}
$title = trim($row['title']) === ''
? '<em>[' . $lang->sL('LLL:EXT:lang/locallang_core.xlf:labels.no_title', true) . ']</em>'
? '<em>[' . htmlspecialchars($lang->sL('LLL:EXT:lang/locallang_core.xlf:labels.no_title')) . ']</em>'
: $title;
}
return $title;
......
......@@ -409,11 +409,11 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
if (substr($field, 0, 6) == 'table_') {
$f2 = substr($field, 6);
if ($GLOBALS['TCA'][$f2]) {
$theData[$field] = '&nbsp;' . '<span title="' . $this->getLanguageService()->sL($GLOBALS['TCA'][$f2]['ctrl']['title'], true) . '">' . $this->iconFactory->getIconForRecord($f2, array(), Icon::SIZE_SMALL)->render() . '</span>';
$theData[$field] = '&nbsp;' . '<span title="' . htmlspecialchars($this->getLanguageService()->sL($GLOBALS['TCA'][$f2]['ctrl']['title'])) . '">' . $this->iconFactory->getIconForRecord($f2, array(), Icon::SIZE_SMALL)->render() . '</span>';
}
} else {
$theData[$field] = '&nbsp;&nbsp;<strong>'
. $this->getLanguageService()->sL($GLOBALS['TCA']['pages']['columns'][$field]['label'], true)
. htmlspecialchars($this->getLanguageService()->sL($GLOBALS['TCA']['pages']['columns'][$field]['label']))
. '</strong>' . $eI;
}
}
......@@ -809,7 +809,7 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
$viewLink = '';
if (!VersionState::cast($this->getPageLayoutController()->pageinfo['t3ver_state'])->equals(VersionState::DELETE_PLACEHOLDER)) {
$onClick = BackendUtility::viewOnClick($this->id, '', BackendUtility::BEgetRootLine($this->id), '', '', ('&L=' . $lP));
$viewLink = '<a href="#" class="btn btn-default btn-sm" onclick="' . htmlspecialchars($onClick) . '" title="' . $this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:labels.showPage', true) . '">' . $this->iconFactory->getIcon('actions-view', Icon::SIZE_SMALL)->render() . '</a>';
$viewLink = '<a href="#" class="btn btn-default btn-sm" onclick="' . htmlspecialchars($onClick) . '" title="' . htmlspecialchars($this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:labels.showPage')) . '">' . $this->iconFactory->getIcon('actions-view', Icon::SIZE_SMALL)->render() . '</a>';
}
// Language overlay page header:
if ($lP) {
......@@ -968,7 +968,7 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
$theData = array();
$theData = $this->headerFields($this->fieldArray, $table, $theData);