Skip to content

Commit

Permalink
fix regex when "|_" filter is followed by another filter (#580)
Browse files Browse the repository at this point in the history
fix theme scanner when "_" filter is followed by another filter (e.g. " | _ | capitalize")
  • Loading branch information
mjauvin authored Jun 18, 2020
1 parent dfd82e4 commit 698829d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions classes/ThemeScanner.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ protected function processStandardTags($content)

$quoteChar = preg_quote("'");

preg_match_all('#{{\s*'.$quoteChar.'([^'.$quoteChar.']+)'.$quoteChar.'\s*[|]\s*_\s*}}#', $content, $match);
preg_match_all('#{{\s*'.$quoteChar.'([^'.$quoteChar.']+)'.$quoteChar.'\s*[|]\s*_\s*(?:[|].+)?}}#', $content, $match);
if (isset($match[1])) {
$messages = array_merge($messages, $match[1]);
}
Expand All @@ -176,7 +176,7 @@ protected function processStandardTags($content)

$quoteChar = preg_quote('"');

preg_match_all('#{{\s*'.$quoteChar.'([^'.$quoteChar.']+)'.$quoteChar.'\s*[|]\s*_\s*}}#', $content, $match);
preg_match_all('#{{\s*'.$quoteChar.'([^'.$quoteChar.']+)'.$quoteChar.'\s*[|]\s*_\s*(?:[|].+)?}}#', $content, $match);
if (isset($match[1])) {
$messages = array_merge($messages, $match[1]);
}
Expand Down

0 comments on commit 698829d

Please sign in to comment.