Skip to content

T17002 volt escape sequence#17003

Merged
niden merged 2 commits into
5.0.xfrom
T17002-volt-escape-sequence
May 13, 2026
Merged

T17002 volt escape sequence#17003
niden merged 2 commits into
5.0.xfrom
T17002-volt-escape-sequence

Conversation

@niden
Copy link
Copy Markdown
Member

@niden niden commented May 13, 2026

Hello!

In raising this pull request, I confirm the following:

  • I have read and understood the Contributing Guidelines
  • I have checked that another pull request for this purpose does not exist
  • I wrote some tests for this PR
  • I have updated the relevant CHANGELOG
  • I have created a PR for the documentation about this change

Fixed Phalcon\Mvc\View\Engine\Volt\Compiler rejecting single-quoted Volt string literals containing an escaped single quote (e.g. {{ 'Let\'s Encrypt' }}) with a downstream PHP T_STRING parse error; the Volt scanner already preserves the user-written \' verbatim in expr["value"], so the compiler's str_replace("'", "\\'", expr["value"]) step double-escaped it into Let\\'s Encrypt, producing PHP source 'Let\\'s Encrypt' that PHP read as Let\ followed by an unexpected identifier. Dropped the redundant str_replace; the scanner's regex ((['] ([\\][']|[\\].|...) ['])) guarantees expr["value"] is already valid PHP single-quoted string content

Thanks

@niden niden merged commit f1f9ced into 5.0.x May 13, 2026
287 of 288 checks passed
@niden niden deleted the T17002-volt-escape-sequence branch May 13, 2026 12:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant