Browse Source

Cleanup

pull/13933/head
brandonkelly 2 years ago
parent
commit
7fd7bb24ce
No known key found for this signature in database GPG Key ID: 5E86D0CED64C7093
  1. 17
      src/web/twig/Extension.php

17
src/web/twig/Extension.php

@ -1628,17 +1628,12 @@ class Extension extends AbstractExtension implements GlobalsInterface
*/
private function _checkFilterSupport($arrow): void
{
if (is_string($arrow)) {
$forbidden = ['system', 'passthru', 'exec'];
$arrow = strtolower($arrow);
if (isset($arrow[0]) && $arrow[0] === "\\") {
$arrow = substr($arrow, 1);
}
if (in_array($arrow, $forbidden, true)) {
throw new RuntimeError('Not supported in this filter.');
}
if (is_string($arrow) && in_array(ltrim(strtolower($arrow), '\\'), [
'system',
'passthru',
'exec',
])) {
throw new RuntimeError('Not supported in this filter.');
}
}

Loading…
Cancel
Save