Bug #39604

TemplateParser unquoteString does not trim escaped quotes correctly

Added by Alexander Berl about 9 years ago. Updated about 9 years ago.

Status:
Resolved
Priority:
Must have
Category:
Core
Target version:
-
Start date:
2012-08-08
Due date:
% Done:

100%

Estimated time:
Has patch:
No

Description

Assume the following case:
<f:alias map="{foo: '\'bar\''}"> {foo} </f:alias>

Epected:
Output 'bar' (including the quotes)

Actual:
Output 'bar\

Cause:
unquoteString uses trim() to strip starting and ending quotes, however trim is not restricted to trimming only one char on both sides, hence removes both trailing single quotes from the input string, leaving "\'bar\" to be unescaped.

Solution:
preg_replace should be used instead with a non-repeating pattern, e.g. preg_replace('/(^\'|\'$)/', '', $quotedValue)

#1

Updated by Gerrit Code Review about 9 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/13511

#2

Updated by Gerrit Code Review about 9 years ago

Patch set 2 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/13511

#3

Updated by Gerrit Code Review about 9 years ago

Patch set 1 for branch FLOW3-1.1 has been pushed to the review server.
It is available at http://review.typo3.org/13557

#4

Updated by Alexander Berl about 9 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

Also available in: Atom PDF