Skip to content

Commit 91dd89d

Browse files
committed
check if function exists before including it in twig
1 parent 0697141 commit 91dd89d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Twig_Extension.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -988,6 +988,10 @@ public function getFunctions() {
988988
$allowed_functions = apply_filters( 'clarkson_twig_functions', $this->functions );
989989

990990
foreach ( $allowed_functions as $function ) {
991+
if ( ! function_exists( $function ) ) {
992+
continue;
993+
}
994+
991995
$twig_functions[] = new \Twig\TwigFunction( $function, $function );
992996
}
993997

0 commit comments

Comments
 (0)