Project

General

Profile

Actions

Bug #99023

closed

Regular expression is not escaped and causes errors

Added by Dmitry Dulepov about 2 years ago. Updated almost 2 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Backend API
Target version:
-
Start date:
2022-11-08
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
11
PHP Version:
7.4
Tags:
Complexity:
no-brainer
Is Regression:
Sprint Focus:

Description

In ExtensionManagementUtility:

                            switch ($positionIdentifier) {
                                case 'after':
                                case 'before':
                                    if (preg_match('/\\b' . $entityName . '\\b/', $palette['showitem']) > 0 || $entityName === 'palette:' . $paletteName) {

Function parameter $position is set to 'before:--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:tabs.media'.
Variable $entityName becomes '--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:tabs.media'

Called from https://github.com/georgringer/eventnews/blob/main/Configuration/TCA/Overrides/tx_news_domain_model_news.php#L102

Result is an exception:

[ TYPO3\CMS\Core\Error\Exception ]                                                                                                           
  Warning: preg_match(): Unknown modifier 'R' in /var/www/html/html/typo3/sysext/core/Classes/Utility/ExtensionManagementUtility.php line 277

Files

dbg.png (1.17 MB) dbg.png Dmitry Dulepov, 2022-11-08 15:36

Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #98960: Migration from switchable Controller Actions incompleteClosedBenni Mack2022-10-31

Actions
Actions

Also available in: Atom PDF