Skip to content
Snippets Groups Projects

Issue #3491615: Support for pipes inside of strings

Open Keshav Patel requested to merge issue/token_or-3491615:3491615-support-for-pipes into 2.x
1 file
+ 1
1
Compare changes
  • Side-by-side
  • Inline
@@ -45,7 +45,7 @@ class TokenOrTokensPreAlter {
foreach (reset($matches) as $match) {
if (strpos($match, '|') !== FALSE) {
$match_clean = substr(substr($match, 1), 0, -1);
$sub_tokens = explode('|', $match_clean);
$sub_tokens = preg_split('/\|(?=(?:[^"]*"[^"]*")*[^"]*$)/', $match_clean);
foreach ($sub_tokens as $sub_token) {
if (substr($sub_token, 0, 1) === '"' && substr($sub_token, -1, 1) === '"') {
Loading