Bug #39604

TemplateParser unquoteString does not trim escaped quotes correctly

Added by Alexander Berl almost 3 years ago. Updated almost 3 years ago.

Status:Resolved Start date:2012-08-08
Priority:Must have Due date:
Assigned To:Alexander Berl % Done:

100%

Category:Core
Target version:-
Has patch:No Affected Flow version:FLOW3 1.1.0 rc 2

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)

Associated revisions

Revision 009b1fc6
Added by Alexander Berl almost 3 years ago

[BUGFIX] TemplateParser unquoteString does not trim escaped quotes correctly

This change fixes wrong trimming of trailing quotes in escaped sequences
by replacing trim() calls with a preg_replace() alternative.

Change-Id: I6acbc97925f5ad2804ffa11dab6f7710dd743280
Fixes: #39604
Releases: 1.1, 1.2

Revision c852f275
Added by Alexander Berl almost 3 years ago

[BUGFIX] TemplateParser unquoteString does not trim escaped quotes correctly

This change fixes wrong trimming of trailing quotes in escaped sequences
by replacing trim() calls with a preg_replace() alternative.

Change-Id: I6acbc97925f5ad2804ffa11dab6f7710dd743280
Fixes: #39604
Releases: 1.1, 1.2

History

#1 Updated by Gerrit Code Review almost 3 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 almost 3 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 almost 3 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 almost 3 years ago

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

Also available in: Atom PDF