Issue Bug Closed

#99023Regular expression is not escaped and causes errors

Dmitry Dulepov 11/08/22, 15:38 updated 12/06/22, 21:52

Description

dbg.png

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

Reviews 3