Commit 209ee46d authored by Valentin Despa's avatar Valentin Despa Committed by Morton Jonuschat
Browse files

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

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

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


Reviewed-by: Wouter Wolters's avatarWouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters's avatarWouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: default avatarMichael Oehlhof <typo3@oehlhof.de>
Reviewed-by: default avatarMorton Jonuschat <m.jonuschat@mojocode.de>
Tested-by: default avatarMorton Jonuschat <m.jonuschat@mojocode.de>
parent 976a3a78
......@@ -322,7 +322,7 @@ class ElementInformationController
$showLink .= '
<a class="btn btn-primary" href="' . htmlspecialchars($url) . '" target="_blank">
' . $this->iconFactory->getIcon('actions-document-view', Icon::SIZE_SMALL)->render() . '
' . $this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:labels.show', true) . '
' . htmlspecialchars($this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:labels.show')) . '
</a>';
}
}
......@@ -344,15 +344,15 @@ class ElementInformationController
$lang = $this->getLanguageService();
if (in_array($this->type, array('folder', 'file'), true)) {
if ($this->type === 'file') {
$extraFields['creation_date'] = $lang->sL('LLL:EXT:lang/locallang_general.xlf:LGL.creationDate', true);
$extraFields['modification_date'] = $lang->sL('LLL:EXT:lang/locallang_general.xlf:LGL.timestamp', true);
$extraFields['creation_date'] = htmlspecialchars($lang->sL('LLL:EXT:lang/locallang_general.xlf:LGL.creationDate'));
$extraFields['modification_date'] = htmlspecialchars($lang->sL('LLL:EXT:lang/locallang_general.xlf:LGL.timestamp'));
}
$extraFields['storage'] = $lang->sL('LLL:EXT:lang/locallang_tca.xlf:sys_file.storage', true);
$extraFields['folder'] = $lang->sL('LLL:EXT:lang/locallang_common.xlf:folder', true);
$extraFields['storage'] = htmlspecialchars($lang->sL('LLL:EXT:lang/locallang_tca.xlf:sys_file.storage'));
$extraFields['folder'] = htmlspecialchars($lang->sL('LLL:EXT:lang/locallang_common.xlf:folder'));
} else {
$extraFields['crdate'] = $lang->sL('LLL:EXT:lang/locallang_general.xlf:LGL.creationDate', true);
$extraFields['cruser_id'] = $lang->sL('LLL:EXT:lang/locallang_general.xlf:LGL.creationUserId', true);
$extraFields['tstamp'] = $lang->sL('LLL:EXT:lang/locallang_general.xlf:LGL.timestamp', true);
$extraFields['crdate'] = htmlspecialchars($lang->sL('LLL:EXT:lang/locallang_general.xlf:LGL.creationDate'));
$extraFields['cruser_id'] = htmlspecialchars($lang->sL('LLL:EXT:lang/locallang_general.xlf:LGL.creationUserId'));
$extraFields['tstamp'] = htmlspecialchars($lang->sL('LLL:EXT:lang/locallang_general.xlf:LGL.timestamp'));
// check if the special fields are defined in the TCA ctrl section of the table
foreach ($extraFields as $fieldName => $fieldLabel) {
......@@ -422,7 +422,7 @@ class ElementInformationController
// format file size as bytes/kilobytes/megabytes
if ($this->type === 'file' && $name === 'size') {
$this->row[$name] = GeneralUtility::formatSize($this->row[$name], $this->getLanguageService()->sL('LLL:EXT:lang/locallang_common.xlf:byteSizeUnits', true));
$this->row[$name] = GeneralUtility::formatSize($this->row[$name], htmlspecialchars($this->getLanguageService()->sL('LLL:EXT:lang/locallang_common.xlf:byteSizeUnits')));
}
$isExcluded = !(!$GLOBALS['TCA'][$this->table]['columns'][$name]['exclude'] || $this->getBackendUser()->check('non_exclude_fields', $this->table . ':' . $name));
......@@ -431,7 +431,7 @@ class ElementInformationController
}
$itemValue = BackendUtility::getProcessedValue($this->table, $name, $this->row[$name], 0, 0, false, $uid);
$itemLabel = $lang->sL(BackendUtility::getItemLabel($this->table, $name), true);
$itemLabel = htmlspecialchars($lang->sL(BackendUtility::getItemLabel($this->table, $name)));
$tableRows[] = '
<tr>
<th class="col-nowrap">' . $itemLabel . '</th>
......@@ -460,13 +460,13 @@ class ElementInformationController
case 'db': {
$references = $this->makeRef($this->table, $this->row['uid']);
if (!empty($references)) {
$content .= '<h3>' . $this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:show_item.php.referencesToThisItem', true) . '</h3>';
$content .= '<h3>' . htmlspecialchars($this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:show_item.php.referencesToThisItem')) . '</h3>';
$content .= $references;
}
$referencesFrom = $this->makeRefFrom($this->table, $this->row['uid']);
if (!empty($referencesFrom)) {
$content .= '<h3>' . $this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:show_item.php.referencesFromThisItem', true) . '</h3>';
$content .= '<h3>' . htmlspecialchars($this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:show_item.php.referencesFromThisItem')) . '</h3>';
$content .= $referencesFrom;
}
break;
......@@ -477,7 +477,7 @@ class ElementInformationController
$references = $this->makeRef('_FILE', $this->fileObject);
if (!empty($references)) {
$content .= '<h3>' . $this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:show_item.php.referencesToThisItem', true) . '</h3>';
$content .= '<h3>' . htmlspecialchars($this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:show_item.php.referencesToThisItem')) . '</h3>';
$content .= $references;
}
}
......@@ -501,7 +501,7 @@ class ElementInformationController
$backLink .= '
<a class="btn btn-primary" href="' . htmlspecialchars($returnUrl) . '">
' . $this->iconFactory->getIcon('actions-view-go-back', Icon::SIZE_SMALL)->render() . '
' . $this->getLanguageService()->sL('LLL:EXT:lang/locallang_common.xlf:back', true) . '
' . htmlspecialchars($this->getLanguageService()->sL('LLL:EXT:lang/locallang_common.xlf:back')) . '
</a>';
}
return $backLink;
......@@ -526,7 +526,7 @@ class ElementInformationController
}
$uid = $this->row['uid'];
$itemValue = BackendUtility::getProcessedValue($this->table, $name, $this->row[$name], 0, 0, false, $uid);
$itemLabel = $this->getLanguageService()->sL(BackendUtility::getItemLabel($this->table, $name), true);
$itemLabel = htmlspecialchars($this->getLanguageService()->sL(BackendUtility::getItemLabel($this->table, $name)));
$tableRows[] = '
<tr>
<th>' . $itemLabel . '</th>
......@@ -616,7 +616,7 @@ class ElementInformationController
// View page button
$viewOnClick = BackendUtility::viewOnClick($uid, '', BackendUtility::BEgetRootLine($uid));
$pageActionIcons .= '
<a class="btn btn-default btn-sm" href="#" onclick="' . htmlspecialchars($viewOnClick) . '" title="' . $this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:labels.showPage', true) . '">
<a class="btn btn-default btn-sm" href="#" onclick="' . htmlspecialchars($viewOnClick) . '" title="' . htmlspecialchars($this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:labels.showPage')) . '">
' . $this->iconFactory->getIcon('actions-document-view', Icon::SIZE_SMALL)->render() . '
</a>';
}
......@@ -704,7 +704,7 @@ class ElementInformationController
' . BackendUtility::getRecordTitle($row['tablename'], $record, true) . '
</a>
</td>
<td>' . $lang->sL($GLOBALS['TCA'][$row['tablename']]['ctrl']['title'], true) . '</td>
<td>' . htmlspecialchars($lang->sL($GLOBALS['TCA'][$row['tablename']]['ctrl']['title'])) . '</td>
<td>
<span title="' . $lang->sL('LLL:EXT:lang/locallang_common.xlf:page') . ': '
. htmlspecialchars($parentRecordTitle) . ' (uid=' . $record['pid'] . ')">
......@@ -806,7 +806,7 @@ class ElementInformationController
' . BackendUtility::getRecordTitle($row['ref_table'], $record, true) . '
</a>
</td>
<td>' . $lang->sL($GLOBALS['TCA'][$row['ref_table']]['ctrl']['title'], true) . '</td>
<td>' . htmlspecialchars($lang->sL($GLOBALS['TCA'][$row['ref_table']]['ctrl']['title'])) . '</td>
<td>' . htmlspecialchars($row['ref_uid']) . '</td>
<td>' . htmlspecialchars($this->getLabelForTableColumn($table, $row['field'])) . '</td>
<td>' . htmlspecialchars($row['flexpointer']) . '</td>
......@@ -820,7 +820,7 @@ class ElementInformationController
<tr>
<td class="col-icon"></td>
<td class="col-title">' . $lang->sL('LLL:EXT:lang/locallang_core.xlf:show_item.php.missing_record') . ' (uid=' . (int)$row['recuid'] . ')</td>
<td>' . $lang->sL($GLOBALS['TCA'][$row['ref_table']]['ctrl']['title'], true) . '</td>
<td>' . htmlspecialchars($lang->sL($GLOBALS['TCA'][$row['ref_table']]['ctrl']['title'])) . '</td>
<td></td>
<td>' . htmlspecialchars($this->getLabelForTableColumn($table, $row['field'])) . '</td>
<td>' . htmlspecialchars($row['flexpointer']) . '</td>
......
......@@ -108,8 +108,8 @@ class EditFileController extends AbstractModule
}
// Cleaning and checking target directory
if (!$this->fileObject) {
$title = $this->getLanguageService()->sL('LLL:EXT:lang/locallang_mod_file_list.xlf:paramError', true);
$message = $this->getLanguageService()->sL('LLL:EXT:lang/locallang_mod_file_list.xlf:targetNoDir', true);
$title = htmlspecialchars($this->getLanguageService()->sL('LLL:EXT:lang/locallang_mod_file_list.xlf:paramError'));
$message = htmlspecialchars($this->getLanguageService()->sL('LLL:EXT:lang/locallang_mod_file_list.xlf:targetNoDir'));
throw new \RuntimeException($title . ': ' . $message, 1294586841);
}
if ($this->fileObject->getStorage()->getUid() === 0) {
......
......@@ -50,7 +50,7 @@ class ElementBrowserRecordList extends DatabaseRecordList
public function linkWrapItems($table, $uid, $code, $row)
{
if (!$code) {
$code = '<i>[' . $this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:labels.no_title', true) . ']</i>';
$code = '<i>[' . htmlspecialchars($this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:labels.no_title')) . ']</i>';
} else {
$code = BackendUtility::getRecordTitlePrep($code, $this->fixedL);
}
......
......@@ -139,7 +139,7 @@ class ConfigurationForm extends ExtendedTemplateService
}
$content .= $addFields;
$content .= $printFields;
$content .= '<input class="btn btn-default" type="submit" name="submit" value="' . $this->getLanguageService()->sL('LLL:EXT:lang/locallang_tsfe.xlf:update', true) . '" id="configuration-submit-' . htmlspecialchars($extKey) . '" />';
$content .= '<input class="btn btn-default" type="submit" name="submit" value="' . htmlspecialchars($this->getLanguageService()->sL('LLL:EXT:lang/locallang_tsfe.xlf:update')) . '" id="configuration-submit-' . htmlspecialchars($extKey) . '" />';
$example = $this->ext_displayExample();
$content .= $example ? '<hr/>' . $example : '';
return $content;
......
......@@ -1317,7 +1317,7 @@ class ExtendedTemplateService extends TemplateService
$userTyposcriptStyle = 'style="display:none;"';
$defaultTyposcriptStyle = '';
}
$deleteTitle = $this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:labels.deleteTitle', true);
$deleteTitle = htmlspecialchars($this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:labels.deleteTitle'));
$deleteIcon = $iconFactory->getIcon('actions-edit-undo', Icon::SIZE_SMALL)->render();
$deleteIconHTML =
'<button type="button" class="btn btn-default t3js-toggle" data-toggle="undo" rel="' . $idName . '">'
......@@ -1325,7 +1325,7 @@ class ExtendedTemplateService extends TemplateService
. $deleteIcon
. '</span>'
. '</button>';
$editTitle = $this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:labels.editTitle', true);
$editTitle = htmlspecialchars($this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:labels.editTitle'));
$editIcon = $iconFactory->getIcon('actions-open', Icon::SIZE_SMALL)->render();
$editIconHTML =
'<button type="button" class="btn btn-default t3js-toggle" data-toggle="edit" rel="' . $idName . '">'
......
......@@ -724,9 +724,9 @@ class SetupModuleController extends AbstractModule
$modName = $subData['name'];
$modules .= '<option value="' . htmlspecialchars($modName) . '"';
$modules .= $this->getBackendUser()->uc['startModule'] === $modName ? ' selected="selected"' : '';
$modules .= '>' . $this->getLanguageService()->sL($this->loadModules->getLabelsForModule($modName)['title'], true) . '</option>';
$modules .= '>' . htmlspecialchars($this->getLanguageService()->sL($this->loadModules->getLabelsForModule($modName)['title'])) . '</option>';
}
$groupLabel = $this->getLanguageService()->sL($this->loadModules->getLabelsForModule($mainMod)['title'], true);
$groupLabel = htmlspecialchars($this->getLanguageService()->sL($this->loadModules->getLabelsForModule($mainMod)['title']));
$startModuleSelect .= '<optgroup label="' . htmlspecialchars($groupLabel) . '">' . $modules . '</optgroup>';
}
}
......
......@@ -88,8 +88,8 @@ class TypoScriptTemplateInformationModuleFunctionController extends AbstractFunc
];
$url = BackendUtility::getModuleUrl('record_edit', $urlParameters);
}
$title = $lang->sL('LLL:EXT:lang/locallang_common.xlf:editField', true);
$startAnchor = '<a href="' . htmlspecialchars($url) . '" title="' . $title . '">';
$title = $lang->sL('LLL:EXT:lang/locallang_common.xlf:editField');
$startAnchor = '<a href="' . htmlspecialchars($url) . '" title="' . htmlspecialchars($title) . '">';
$icon = $this->iconFactory->getIcon('actions-document-open', Icon::SIZE_SMALL)->render();
$ret = '<tr><td>';
$ret .= $startAnchor . '<strong>' . $label . '</strong></a>';
......
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