Fixed
Project:
Token OR
Version:
2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
4 Dec 2024 at 12:47 UTC
Updated:
26 Oct 2026 at 17:19 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
ok4p1 commentedComment #3
ok4p1 commentedComment #4
ok4p1 commentedComment #5
pianomansam commented@ok4p1 thanks for the bug report and the patch file. In order for this to be considered, please open a Merge Request with your changes. Also, please write a test showing that it solves the issue.
Comment #8
keshav patel commentedRaised an MR with the provided patch on #4#4,
Keeping it on Needs work until tests are added.
Comment #10
pianomansam commentedCommitted to 2.x, thanks everyone!
@ok4p1 thanks for the report and the original patch, and @Keshav Patel for turning it into an MR.
Quoted strings can now contain pipes:
[node:field_title_social|node:field_headline|"My Awesome Title | My Company"]Before committing I added tests, and made one change to the approach. The lookahead regex in
preg_split()re-scans to the end of the token from every pipe. On long input (around 150 KB of pipes and quotes) PCRE gave up with "JIT stack limit exhausted" and returnedFALSE, which then caused a fatal error. Since token replacement can run over editor-entered content (e.g. with token_filter), I replaced it with a single pass over the string that tracks whether it's inside quotes. The result is the same for well-formed tokens, and there's a test covering the long-input case.This will be in the next 2.x release.