Project

General

Profile

Actions

Bug #81773

closed

Empty constants are not correct replaced after Patch

Added by Pascal Hinz almost 7 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
TypoScript
Target version:
Start date:
2017-07-03
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
8
PHP Version:
Tags:
Complexity:
easy
Is Regression:
Sprint Focus:
On Location Sprint

Description

After the Patch (https://github.com/TYPO3/TYPO3.CMS/commit/ac9baec4461c232e1a88d181da14f53f6146a8d5) "Prevent different constants marker in TS parsing" empty constants are not replaced correct.
The markers (##11f99e_B####11f99e_E##) are left after the replacing process and are visible in the TypoScript Template ObjectBrowser (see screenshots).
It seems that the bug doesn't have any effects on the functionality of the TYPO3 instance.

How to reproduce:
1 ) Open the Typoscript ObjectBrowser in the setup mode
2) Disable the option "Crop lines"
3) Select "Substituted constants in green"
4) Type in the search "_B##" and you will find in the result something like "##64e3d7_B####64e3d7_E##"

How to fix:
1) Just fix the regular expression in the ExtendedTemplateService.php

TYPO3 7.6.19
File: typo3_src-7.6.19/typo3/sysext/core/Classes/TypoScript/ExtendedTemplateService.php (line 320):
Replace: '/##[a-z0-9]{6}_B##((?:(?!##[a-z0-9]{6}_E##).)+)##[a-z0-9]{6}_E##/',
With: '/##[a-z0-9]{6}_B##((?:(?!##[a-z0-9]{6}_E##).)+)?##[a-z0-9]{6}_E##/',

TYPO3 8.7.2
File: typo3_src-8.7.2/typo3/sysext/core/Classes/TypoScript/ExtendedTemplateService.php (line 316)
Replace: '/##[a-z0-9]{6}_B##((?:(?!##[a-z0-9]{6}_E##).)+)##[a-z0-9]{6}_E##/',
With: '/##[a-z0-9]{6}_B##((?:(?!##[a-z0-9]{6}_E##).)+)?##[a-z0-9]{6}_E##/',

I'll try to make a patch for the bug.


Files

Actions

Also available in: Atom PDF