From 9c629e3b9651e0d892c8768afb9c3eac04f16646 Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Mon, 15 May 2023 12:40:52 +0200 Subject: Updates for twig-2+ --- lib/twig.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/lib/twig.php b/lib/twig.php index db1354d..7de451e 100644 --- a/lib/twig.php +++ b/lib/twig.php @@ -1,7 +1,6 @@ build_pagename($name); - return rawWiki($page); + $source = rawWiki($page); + + if (!$source) { + throw new \Twig\Error\LoaderError(sprintf('Template "%s" does not exist.', $name)); + } + + return new \Twig\Source($source, $name); } public function getCacheKey($name) -- cgit v1.2.3-1-g7c22