Skip to content

Commit

Permalink
[BUGFIX] Only pass strings to string functions in EXT:backend
Browse files Browse the repository at this point in the history
Fix some failures that occur if the internal classes in EXT:backend
use strict typing.

Resolves: #101325
Releases: main, 12.4, 11.5
Change-Id: I964b802762991b6409e599d7a746bdbe22740dfb
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/80015
Tested-by: Stefan B�rk <stefan@buerk.tech>
Reviewed-by: Stefan B�rk <stefan@buerk.tech>
Tested-by: core-ci <typo3@b13.com>
  • Loading branch information
oliverklee authored and sbuerk committed Jul 12, 2023
1 parent 15128a1 commit f054833
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion typo3/sysext/backend/Classes/View/BackendLayoutView.php
Expand Up @@ -150,7 +150,7 @@ public function addBackendLayoutItems(array &$parameters)
*/
protected function determinePageId($tableName, array $data)
{
if (strpos($data['uid'], 'NEW') === 0) {
if (strpos((string)$data['uid'], 'NEW') === 0) {
// negative uid_pid values of content elements indicate that the element
// has been inserted after an existing element so there is no pid to get
// the backendLayout for and we have to get that first
Expand Down
Expand Up @@ -1642,7 +1642,7 @@ public function makeControl($table, $row)
}

// "Delete" link:
$disableDelete = (bool)\trim($userTsConfig['options.']['disableDelete.'][$table] ?? $userTsConfig['options.']['disableDelete'] ?? false);
$disableDelete = (bool)\trim((string)($userTsConfig['options.']['disableDelete.'][$table] ?? $userTsConfig['options.']['disableDelete'] ?? ''));
if ($permsEdit
&& !$disableDelete
&& (($table === 'pages' && $localCalcPerms->deletePagePermissionIsGranted()) || ($table !== 'pages' && $this->calcPerms->editContentPermissionIsGranted()))
Expand Down Expand Up @@ -1671,7 +1671,7 @@ public function makeControl($table, $row)
. ' aria-label="' . $linkTitle . '"'
. ' aria-haspopup="dialog"'
. ' data-button-ok-text="' . htmlspecialchars($linkTitle) . '"'
. ' data-l10parent="' . ($l10nParentField ? htmlspecialchars($row[$l10nParentField]) : '') . '"'
. ' data-l10parent="' . ($l10nParentField ? htmlspecialchars((string)$row[$l10nParentField]) : '') . '"'
. ' data-params="' . htmlspecialchars($params) . '"'
. ' data-message="' . htmlspecialchars($warningText) . '">'
. $icon
Expand Down Expand Up @@ -3314,7 +3314,7 @@ protected function renderMultiRecordSelectionActions(string $table, array $curre
</span>
</button>';

if (!(bool)trim(($userTsConfig['options.']['disableDelete.'][$table] ?? $userTsConfig['options.']['disableDelete'] ?? false))) {
if (!(bool)trim((string)($userTsConfig['options.']['disableDelete.'][$table] ?? $userTsConfig['options.']['disableDelete'] ?? ''))) {
$deleteActionConfiguration = GeneralUtility::jsonEncodeForHtmlAttribute([
'idField' => 'uid',
'ok' => $lang->sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:cm.delete'),
Expand Down

0 comments on commit f054833

Please sign in to comment.