Commit e7f6fa1d authored by Georg Ringer's avatar Georg Ringer Committed by Daniel Goerz
Browse files

[TASK] Remove needless string concatenations

Replace string concatenations like 'abc' . 'def' with 'abcdef'.

Resolves: #87004
Releases: master
Change-Id: I9c1a610e88dd4bd4e617214989a915b1dafda094
Reviewed-on: https://review.typo3.org/c/60155

Reviewed-by: Markus Klein's avatarMarkus Klein <markus.klein@typo3.org>
Reviewed-by: default avatarGuido Schmechel <guido.schmechel@brandung.de>
Reviewed-by: Daniel Goerz's avatarDaniel Goerz <daniel.goerz@posteo.de>
Tested-by: default avatarTYPO3com <noreply@typo3.com>
Tested-by: Markus Klein's avatarMarkus Klein <markus.klein@typo3.org>
Tested-by: Daniel Goerz's avatarDaniel Goerz <daniel.goerz@posteo.de>
parent bcae19b4
......@@ -96,7 +96,7 @@ class FormFlexAjaxController extends AbstractFormEngineAjaxController
$formData['flexFormContainerIdentifier'] = $flexFormContainerIdentifier;
$formData['flexFormContainerElementCollapsed'] = false;
$formData['flexFormFormPrefix'] = '[data][' . $flexFormSheetName . '][lDEF]' . '[' . $flexFormFieldName . ']' . '[el]';
$formData['flexFormFormPrefix'] = '[data][' . $flexFormSheetName . '][lDEF][' . $flexFormFieldName . '][el]';
// Set initialized data of that section container from compiler to the array part used
// by flexFormElementContainer which prepares parameterArray. Important for initialized
......
......@@ -719,7 +719,7 @@ class FormInlineAjaxController extends AbstractFormEngineAjaxController
// Substitute FlexForm addition and make parsing a bit easier
$domObjectId = str_replace('---', ':', $domObjectId);
// The starting pattern of an object identifier (e.g. "data-<firstPidValue>-<anything>)
$pattern = '/^data' . '-' . '(.+?)' . '-' . '(.+)$/';
$pattern = '/^data-(.+?)-(.+)$/';
if (preg_match($pattern, $domObjectId, $match)) {
return $match[1];
}
......
......@@ -607,7 +607,7 @@ class NewRecordController
include $extEmConfFile;
$thisTitle = $EM_CONF[$_EXTKEY]['title'];
}
$iconFile[$_EXTKEY] = '<img src="' . PathUtility::getAbsoluteWebPath(ExtensionManagementUtility::getExtensionIcon($extPath, true)) . '" ' . 'width="16" height="16" ' . 'alt="' . $thisTitle . '" />';
$iconFile[$_EXTKEY] = '<img src="' . PathUtility::getAbsoluteWebPath(ExtensionManagementUtility::getExtensionIcon($extPath, true)) . '" width="16" height="16" alt="' . $thisTitle . '" />';
}
}
if (empty($thisTitle)) {
......
......@@ -397,7 +397,7 @@ class SiteInlineAjaxController extends AbstractFormEngineAjaxController
// Substitute FlexForm addition and make parsing a bit easier
$domObjectId = str_replace('---', ':', $domObjectId);
// The starting pattern of an object identifier (e.g. "data-<firstPidValue>-<anything>)
$pattern = '/^data' . '-' . '(.+?)' . '-' . '(.+)$/';
$pattern = '/^data-(.+?)-(.+)$/';
if (preg_match($pattern, $domObjectId, $match)) {
return (int)$match[1];
}
......
......@@ -60,7 +60,7 @@ class FlexFormSectionContainer extends AbstractContainer
$options = $this->data;
$options['flexFormRowData'] = $existingContainerData['el'];
$options['flexFormDataStructureArray'] = $containerDataStructure;
$options['flexFormFormPrefix'] = $this->data['flexFormFormPrefix'] . '[' . $flexFormFieldName . ']' . '[el]';
$options['flexFormFormPrefix'] = $this->data['flexFormFormPrefix'] . '[' . $flexFormFieldName . '][el]';
$options['flexFormContainerName'] = $existingSectionContainerDataStructureType;
$options['flexFormContainerIdentifier'] = $flexFormContainerIdentifier;
$options['flexFormContainerElementCollapsed'] = (bool)$flexFormRowData[$flexFormContainerIdentifier]['_TOGGLE'];
......
......@@ -363,7 +363,7 @@ class InlineControlContainer extends AbstractContainer
}
// Add Drag&Drop functions for sorting to FormEngine::$additionalJS_post
if (count($sortableRecordUids) > 1 && $config['appearance']['useSortable']) {
$resultArray['additionalJavaScriptPost'][] = 'inline.createDragAndDropSorting("' . $nameObject . '_records' . '");';
$resultArray['additionalJavaScriptPost'][] = 'inline.createDragAndDropSorting("' . $nameObject . '_records");';
}
$resultArray['requireJsModules'] = array_merge($resultArray['requireJsModules'], $this->requireJsModules);
......
......@@ -314,7 +314,7 @@ class InlineRecordContainer extends AbstractContainer
$altText = BackendUtility::getRecordIconAltText($rec, $foreignTable);
$iconImg = '<span title="' . $altText . '" id="' . htmlspecialchars($objectId) . '_icon' . '">' . $this->iconFactory->getIconForRecord($foreignTable, $rec, Icon::SIZE_SMALL)->render() . '</span>';
$iconImg = '<span title="' . $altText . '" id="' . htmlspecialchars($objectId) . '_icon">' . $this->iconFactory->getIconForRecord($foreignTable, $rec, Icon::SIZE_SMALL)->render() . '</span>';
$label = '<span id="' . $objectId . '_label">' . $recordTitle . '</span>';
$ctrl = $this->renderForeignRecordHeaderControl($data);
$thumbnail = false;
......@@ -552,14 +552,14 @@ class InlineRecordContainer extends AbstractContainer
$title = htmlspecialchars($languageService->sL('LLL:EXT:core/Resources/Private/Language/locallang_mod_web_list.xlf:unHide' . ($isPagesTable ? 'Page' : '')));
$cells['hide'] = '
<a class="btn btn-default hiddenHandle ' . $className . '" href="#" onclick="
' . htmlspecialchars($onClick) . '"' . 'title="' . $title . '">
' . htmlspecialchars($onClick) . '" title="' . $title . '">
' . $this->iconFactory->getIcon('actions-edit-unhide', Icon::SIZE_SMALL)->render() . '
</a>';
} else {
$title = htmlspecialchars($languageService->sL('LLL:EXT:core/Resources/Private/Language/locallang_mod_web_list.xlf:hide' . ($isPagesTable ? 'Page' : '')));
$cells['hide'] = '
<a class="btn btn-default hiddenHandle ' . $className . '" href="#" onclick="
' . htmlspecialchars($onClick) . '"' . 'title="' . $title . '">
' . htmlspecialchars($onClick) . '" title="' . $title . '">
' . $this->iconFactory->getIcon('actions-edit-hide', Icon::SIZE_SMALL)->render() . '
</a>';
}
......@@ -584,7 +584,7 @@ class InlineRecordContainer extends AbstractContainer
if ($lockInfo = BackendUtility::isRecordLocked($foreignTable, $rec['uid'])) {
$cells['locked'] = '
<a class="btn btn-default" href="#" data-toggle="tooltip" data-title="' . htmlspecialchars($lockInfo['msg']) . '">
' . '<span title="' . htmlspecialchars($lockInfo['msg']) . '">' . $this->iconFactory->getIcon('warning-in-use', Icon::SIZE_SMALL)->render() . '</span>' . '
<span title="' . htmlspecialchars($lockInfo['msg']) . '">' . $this->iconFactory->getIcon('warning-in-use', Icon::SIZE_SMALL)->render() . '</span>
</a>';
}
// Hook: Post-processing of single controls for specific child records:
......
......@@ -62,7 +62,7 @@ class InlineStackProcessor
// Substitute FlexForm addition and make parsing a bit easier
$domObjectId = str_replace('---', ':', $domObjectId);
// The starting pattern of an object identifier (e.g. "data-<firstPidValue>-<anything>)
$pattern = '/^data' . '-' . '(.+?)' . '-' . '(.+)$/';
$pattern = '/^data-(.+?)-(.+)$/';
if (preg_match($pattern, $domObjectId, $match)) {
$inlineFirstPid = $match[1];
......@@ -167,7 +167,7 @@ class InlineStackProcessor
$inlineDomObjectId = '';
// If there are still more inline levels available
if ($current !== false) {
$inlineDomObjectId = 'data' . '-' . $inlineFirstPid . '-' . $this->getStructurePath();
$inlineDomObjectId = 'data-' . $inlineFirstPid . '-' . $this->getStructurePath();
}
return $inlineDomObjectId;
}
......
......@@ -527,7 +527,7 @@ class PagePositionMap
$uid = '';
}
$cc = hexdec(substr(md5($uid . '-' . $vv . '-' . $kk), 0, 4));
return '<a href="#" onclick="' . htmlspecialchars($this->onClickInsertRecord($row, $vv, $moveUid, $pid, $this->cur_sys_language)) . '" data-dismiss="modal">' . '<i class="t3-icon fa fa-long-arrow-left" name="mImgEnd' . $cc . '" title="' . htmlspecialchars($this->getLanguageService()->getLL($this->l_insertNewRecordHere)) . '"></i></a>';
return '<a href="#" onclick="' . htmlspecialchars($this->onClickInsertRecord($row, $vv, $moveUid, $pid, $this->cur_sys_language)) . '" data-dismiss="modal"><i class="t3-icon fa fa-long-arrow-left" name="mImgEnd' . $cc . '" title="' . htmlspecialchars($this->getLanguageService()->getLL($this->l_insertNewRecordHere)) . '"></i></a>';
}
/**
......
......@@ -966,7 +966,7 @@ class PageLayoutView implements LoggerAwareInterface
if ($this->getBackendUser()->checkLanguageAccess($lP) && $columnId !== 'unused') {
$content[$columnId] .= '
<div class="t3-page-ce t3js-page-ce" data-page="' . (int)$id . '" id="' . StringUtility::getUniqueId() . '">
<div class="t3js-page-new-ce t3-page-ce-wrapper-new-ce" id="colpos-' . $columnId . '-' . 'page-' . $id . '-' . StringUtility::getUniqueId() . '">'
<div class="t3js-page-new-ce t3-page-ce-wrapper-new-ce" id="colpos-' . $columnId . '-page-' . $id . '-' . StringUtility::getUniqueId() . '">'
. $link
. '</div>
<div class="t3-page-ce-dropzone-available t3js-page-ce-dropzone-available"></div>
......@@ -1024,7 +1024,7 @@ class PageLayoutView implements LoggerAwareInterface
. $row['uid'] . '" data-table="tt_content" data-uid="' . $row['uid'] . '"' . $displayNone . '>' . $singleElementHTML . '</div>';
$singleElementHTML .= '<div class="t3-page-ce" data-colpos="' . $columnId . '">';
$singleElementHTML .= '<div class="t3js-page-new-ce t3-page-ce-wrapper-new-ce" id="colpos-' . $columnId . '-' . 'page-' . $id .
$singleElementHTML .= '<div class="t3js-page-new-ce t3-page-ce-wrapper-new-ce" id="colpos-' . $columnId . '-page-' . $id .
'-' . StringUtility::getUniqueId() . '">';
// Add icon "new content element below"
if (!$disableMoveAndNewButtons
......@@ -1412,7 +1412,7 @@ class PageLayoutView implements LoggerAwareInterface
}
$out .= '
<tr>
<td valign="top" class="t3-grid-cell">' . implode('</td>' . '
<td valign="top" class="t3-grid-cell">' . implode('</td>
<td valign="top" class="t3-grid-cell">', $cCont) . '</td>
</tr>';
}
......@@ -1472,7 +1472,7 @@ class PageLayoutView implements LoggerAwareInterface
$localizedTableTitle = htmlspecialchars($this->getLanguageService()->sL($GLOBALS['TCA'][$table]['ctrl']['title']));
$out .= '<tr><th class="col-icon"></th>'
. '<th colspan="' . (count($theData) - 2) . '"><span class="c-table">'
. $localizedTableTitle . '</span> (' . $dbCount . ')</td>' . '<td class="col-icon"></td>'
. $localizedTableTitle . '</span> (' . $dbCount . ')</td><td class="col-icon"></td>'
. '</tr>';
// Column's titles
if ($this->doEdit) {
......@@ -1587,7 +1587,7 @@ class PageLayoutView implements LoggerAwareInterface
if ($GLOBALS['TCA'][$table]['columns'][$fName2]) {
$out[$fieldName] .= '<strong>' . htmlspecialchars($this->getLanguageService()->sL(
$GLOBALS['TCA'][$table]['columns'][$fName2]['label']
)) . '</strong>' . '&nbsp;&nbsp;' . htmlspecialchars(GeneralUtility::fixed_lgd_cs(
)) . '</strong>&nbsp;&nbsp;' . htmlspecialchars(GeneralUtility::fixed_lgd_cs(
BackendUtility::getProcessedValue($table, $fName2, $row[$fName2], 0, 0, 0, $row['uid']),
25
)) . '<br />';
......
......@@ -2491,7 +2491,7 @@ This is a dump of the failures:
private function emailAtLogin()
{
// Send notify-mail
$subject = 'At "' . $GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename'] . '"' . ' from ' . GeneralUtility::getIndpEnv('REMOTE_ADDR');
$subject = 'At "' . $GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename'] . '" from ' . GeneralUtility::getIndpEnv('REMOTE_ADDR');
$msg = sprintf(
'User "%s" logged in from %s at "%s" (%s)',
$this->user['username'],
......
......@@ -96,7 +96,7 @@ class MemcachedBackend extends AbstractBackend implements TaggableBackendInterfa
public function __construct($context, array $options = [])
{
if (!extension_loaded('memcache') && !extension_loaded('memcached')) {
throw new Exception('The PHP extension "memcache" or "memcached" must be installed and loaded in ' . 'order to use the Memcached backend.', 1213987706);
throw new Exception('The PHP extension "memcache" or "memcached" must be installed and loaded in order to use the Memcached backend.', 1213987706);
}
parent::__construct($context, $options);
......
......@@ -209,7 +209,7 @@ class PdoBackend extends AbstractBackend implements TaggableBackendInterface
*/
public function collectGarbage()
{
$statementHandle = $this->databaseHandle->prepare('DELETE FROM "tags" WHERE "context"=? AND "cache"=? AND "identifier" IN ' . '(SELECT "identifier" FROM "cache" WHERE "context"=? AND "cache"=? AND "lifetime" > 0 AND "created" + "lifetime" < ' . $GLOBALS['EXEC_TIME'] . ')');
$statementHandle = $this->databaseHandle->prepare('DELETE FROM "tags" WHERE "context"=? AND "cache"=? AND "identifier" IN (SELECT "identifier" FROM "cache" WHERE "context"=? AND "cache"=? AND "lifetime" > 0 AND "created" + "lifetime" < ' . $GLOBALS['EXEC_TIME'] . ')');
$statementHandle->execute([$this->context, $this->cacheIdentifier, $this->context, $this->cacheIdentifier]);
$statementHandle = $this->databaseHandle->prepare('DELETE FROM "cache" WHERE "context"=? AND "cache"=? AND "lifetime" > 0 AND "created" + "lifetime" < ' . $GLOBALS['EXEC_TIME']);
$statementHandle->execute([$this->context, $this->cacheIdentifier]);
......
......@@ -94,7 +94,7 @@ class SimpleFileBackend extends AbstractBackend implements PhpCapableBackendInte
$this->cacheDirectory = $finalCacheDirectory;
$this->cacheEntryFileExtension = $cache instanceof PhpFrontend ? '.php' : '';
if (strlen($this->cacheDirectory) + 23 > PHP_MAXPATHLEN) {
throw new Exception('The length of the temporary cache file path "' . $this->cacheDirectory . '" exceeds the ' . 'maximum path length of ' . (PHP_MAXPATHLEN - 23) . '. Please consider ' . 'setting the temporaryDirectoryBase option to a shorter path.', 1248710426);
throw new Exception('The length of the temporary cache file path "' . $this->cacheDirectory . '" exceeds the maximum path length of ' . (PHP_MAXPATHLEN - 23) . '. Please consider setting the temporaryDirectoryBase option to a shorter path.', 1248710426);
}
}
......
......@@ -5943,7 +5943,7 @@ class DataHandler implements LoggerAwareInterface
$res = false;
if ($GLOBALS['TCA'][$table] && (int)$id > 0) {
$cacheId = 'checkRecordUpdateAccess' . '_' . $table . '_' . $id;
$cacheId = 'checkRecordUpdateAccess_' . $table . '_' . $id;
// If information is cached, return it
$cachedValue = $this->runtimeCache->get($cacheId);
......@@ -6069,7 +6069,7 @@ class DataHandler implements LoggerAwareInterface
*/
protected function doesRecordExist_pageLookUp($id, $perms, $columns = ['uid'])
{
$cacheId = md5('doesRecordExist_pageLookUp' . '_' . $id . '_' . $perms . '_' . implode(
$cacheId = md5('doesRecordExist_pageLookUp_' . $id . '_' . $perms . '_' . implode(
'_',
$columns
) . '_' . (string)$this->admin);
......
......@@ -670,14 +670,14 @@ class QueryGenerator
$lineHTML[] = '<div class="form-inline">';
$lineHTML[] = $this->makeComparisonSelector($subscript, $fieldName, $conf);
if ($conf['comparison'] === 68 || $conf['comparison'] === 69 || $conf['comparison'] === 162 || $conf['comparison'] === 163) {
$lineHTML[] = '<select class="form-control" name="' . $fieldPrefix . '[inputValue]' . '[]" multiple="multiple">';
$lineHTML[] = '<select class="form-control" name="' . $fieldPrefix . '[inputValue][]" multiple="multiple">';
} elseif ($conf['comparison'] === 66 || $conf['comparison'] === 67) {
if (is_array($conf['inputValue'])) {
$conf['inputValue'] = implode(',', $conf['inputValue']);
}
$lineHTML[] = '<input class="form-control t3js-clearable" type="text" value="' . htmlspecialchars($conf['inputValue']) . '" name="' . $fieldPrefix . '[inputValue]' . '">';
$lineHTML[] = '<input class="form-control t3js-clearable" type="text" value="' . htmlspecialchars($conf['inputValue']) . '" name="' . $fieldPrefix . '[inputValue]">';
} else {
$lineHTML[] = '<select class="form-control t3js-submit-change" name="' . $fieldPrefix . '[inputValue]' . '">';
$lineHTML[] = '<select class="form-control t3js-submit-change" name="' . $fieldPrefix . '[inputValue]">';
}
if ($conf['comparison'] != 66 && $conf['comparison'] != 67) {
$lineHTML[] = $this->makeOptionList($fieldName, $conf, $this->table);
......@@ -688,7 +688,7 @@ class QueryGenerator
case 'boolean':
$lineHTML[] = '<div class="form-inline">';
$lineHTML[] = $this->makeComparisonSelector($subscript, $fieldName, $conf);
$lineHTML[] = '<input type="hidden" value="1" name="' . $fieldPrefix . '[inputValue]' . '">';
$lineHTML[] = '<input type="hidden" value="1" name="' . $fieldPrefix . '[inputValue]">';
$lineHTML[] = '</div>';
break;
default:
......@@ -696,10 +696,10 @@ class QueryGenerator
$lineHTML[] = $this->makeComparisonSelector($subscript, $fieldName, $conf);
if ($conf['comparison'] === 37 || $conf['comparison'] === 36) {
// between:
$lineHTML[] = '<input class="form-control t3js-clearable" type="text" value="' . htmlspecialchars($conf['inputValue']) . '" name="' . $fieldPrefix . '[inputValue]' . '">';
$lineHTML[] = '<input class="form-control t3js-clearable" type="text" value="' . htmlspecialchars($conf['inputValue1']) . '" name="' . $fieldPrefix . '[inputValue1]' . '">';
$lineHTML[] = '<input class="form-control t3js-clearable" type="text" value="' . htmlspecialchars($conf['inputValue']) . '" name="' . $fieldPrefix . '[inputValue]">';
$lineHTML[] = '<input class="form-control t3js-clearable" type="text" value="' . htmlspecialchars($conf['inputValue1']) . '" name="' . $fieldPrefix . '[inputValue1]">';
} else {
$lineHTML[] = '<input class="form-control t3js-clearable" type="text" value="' . htmlspecialchars($conf['inputValue']) . '" name="' . $fieldPrefix . '[inputValue]' . '">';
$lineHTML[] = '<input class="form-control t3js-clearable" type="text" value="' . htmlspecialchars($conf['inputValue']) . '" name="' . $fieldPrefix . '[inputValue]">';
}
$lineHTML[] = '</div>';
}
......@@ -746,7 +746,7 @@ class QueryGenerator
$lineHTML[] = ' <div class="input-group">';
$lineHTML[] = $this->mkCompSelect($fieldPrefix . '[comparison]', $conf['comparison'], $conf['negate'] ? 1 : 0);
$lineHTML[] = ' <div class="input-group-addon">';
$lineHTML[] = ' <input type="checkbox" class="checkbox t3js-submit-click"' . ($conf['negate'] ? ' checked' : '') . ' name="' . htmlspecialchars($fieldPrefix) . '[negate]' . '">';
$lineHTML[] = ' <input type="checkbox" class="checkbox t3js-submit-click"' . ($conf['negate'] ? ' checked' : '') . ' name="' . htmlspecialchars($fieldPrefix) . '[negate]">';
$lineHTML[] = ' </div>';
$lineHTML[] = ' </div>';
return implode(LF, $lineHTML);
......
......@@ -186,7 +186,7 @@ class FormProtectionFactory
protected static function createInstance($className, ...$constructorArguments)
{
if (!class_exists($className)) {
throw new \InvalidArgumentException('$className must be the name of an existing class, but ' . 'actually was "' . $className . '".', 1285352962);
throw new \InvalidArgumentException('$className must be the name of an existing class, but actually was "' . $className . '".', 1285352962);
}
$instance = GeneralUtility::makeInstance($className, ...$constructorArguments);
if (!$instance instanceof AbstractFormProtection) {
......
......@@ -228,7 +228,7 @@ class RteHtmlParser extends HtmlParser implements LoggerAwareInterface
// Transform empty paragraphs into spacing paragraphs
$value = str_replace('<p></p>', '<p>&nbsp;</p>', $value);
// Double any trailing spacing paragraph so that it does not get removed by divideIntoLines()
$value = preg_replace('/<p>&nbsp;<\/p>$/', '<p>&nbsp;</p>' . '<p>&nbsp;</p>', $value);
$value = preg_replace('/<p>&nbsp;<\/p>$/', '<p>&nbsp;</p><p>&nbsp;</p>', $value);
$value = $this->TS_transform_db($value);
break;
default:
......
......@@ -809,7 +809,7 @@ class GraphicalFunctions
*/
public function addToMap($cords, $conf)
{
$this->map .= '<area' . ' shape="poly"' . ' coords="' . implode(',', $cords) . '"'
$this->map .= '<area shape="poly" coords="' . implode(',', $cords) . '"'
. ' href="' . htmlspecialchars($conf['url']) . '"'
. ($conf['target'] ? ' target="' . htmlspecialchars($conf['target']) . '"' : '')
. ((string)$conf['titleText'] !== '' ? ' title="' . htmlspecialchars($conf['titleText']) . '"' : '')
......
......@@ -78,7 +78,7 @@ class UserFileInlineLabelService
continue;
}
$labelText = LocalizationUtility::translate('LLL:EXT:core/Resources/Private/Language/locallang_tca.xlf:sys_file.' . $field, 'lang');
$title[] = '<dt>' . htmlspecialchars($labelText) . '</dt>' . '<dd>' . $value . '</dd>';
$title[] = '<dt>' . htmlspecialchars($labelText) . '</dt><dd>' . $value . '</dd>';
}
$params['title'] = '<dl>' . implode('', $title) . '</dl>';
}
......
Markdown is supported
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