Skip to content

Commit

Permalink
Remove preg_quote delimiter argument in ExtensionSet.php
Browse files Browse the repository at this point in the history
  • Loading branch information
smnandre committed Dec 26, 2024
1 parent 37c437b commit 847cac3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/ExtensionSet.php
Original file line number Diff line number Diff line change
Expand Up @@ -436,23 +436,23 @@ private function initExtension(ExtensionInterface $extension): void
foreach ($extension->getFilters() as $filter) {
$this->filters[$name = $filter->getName()] = $filter;
if (str_contains($name, '*')) {
$this->dynamicFilters['#^'.str_replace('\\*', '(.*?)', preg_quote($name, '#')).'$#'] = $filter;
$this->dynamicFilters['#^'.str_replace('\\*', '(.*?)', preg_quote($name)).'$#'] = $filter;
}
}

// functions
foreach ($extension->getFunctions() as $function) {
$this->functions[$name = $function->getName()] = $function;
if (str_contains($name, '*')) {
$this->dynamicFunctions['#^'.str_replace('\\*', '(.*?)', preg_quote($name, '#')).'$#'] = $function;
$this->dynamicFunctions['#^'.str_replace('\\*', '(.*?)', preg_quote($name)).'$#'] = $function;
}
}

// tests
foreach ($extension->getTests() as $test) {
$this->tests[$name = $test->getName()] = $test;
if (str_contains($name, '*')) {
$this->dynamicTests['#^'.str_replace('\\*', '(.*?)', preg_quote($name, '#')).'$#'] = $test;
$this->dynamicTests['#^'.str_replace('\\*', '(.*?)', preg_quote($name)).'$#'] = $test;
}
}

Expand Down

0 comments on commit 847cac3

Please sign in to comment.