From dd37b3edb170354623d45c30cc77c84e57651dfb Mon Sep 17 00:00:00 2001 From: Niels de Blaauw Date: Thu, 5 Nov 2020 10:52:58 +0100 Subject: [PATCH] Fixes issue when calling render with a non-absolute path. If this is an absolute path, we want the realpath. If it is not we take it as it was given to us. --- src/Templates.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Templates.php b/src/Templates.php index 8354698..c965ea7 100644 --- a/src/Templates.php +++ b/src/Templates.php @@ -86,7 +86,10 @@ public function render( $path, $objects, $ignore_warning = false ):void { * @return string */ public function render_twig( $path, $objects, $ignore_warning = false ) { - $path = realpath( $path ); + $clean_path = realpath( $path ); + if ( $clean_path ) { + $path = $clean_path; + } // Twig arguments. if ( ! $ignore_warning && $this->has_been_called ) {