From 2605d6a1c46de67e2ebcefe7bd4010b2a8512a49 Mon Sep 17 00:00:00 2001
From: Hanne Moa <hanne.moa@uninett.no>
Date: Fri, 26 Feb 2016 15:07:49 +0100
Subject: [PATCH] Okay... too much Friday

---
 lib/SimpleSAML/XHTML/Template.php | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/lib/SimpleSAML/XHTML/Template.php b/lib/SimpleSAML/XHTML/Template.php
index fabaf157e..222ce9014 100644
--- a/lib/SimpleSAML/XHTML/Template.php
+++ b/lib/SimpleSAML/XHTML/Template.php
@@ -59,7 +59,14 @@ class SimpleSAML_XHTML_Template
      */
     private function setupTwig()
     {
-        $twig_filename = basename($this->template, '.php').'.twig.html';
+        $namespace = '';
+        $filename = $this->template;
+        $colonpos = strpos($this->template, ':');
+        if ($colonpos === true) {
+            $filename = substr($this->template, $colonpos);
+            $namespace = substr($this->template, 0, $colonpos);
+        }
+        $twig_filename = basename($filename, '.php').'.twig.html';
         $filename = $this->findTemplatePath($twig_filename, $throw_exception=false);
         // twig not in use for this page
         if (is_null($filename)) {
@@ -70,7 +77,7 @@ class SimpleSAML_XHTML_Template
         $this->template = $twig_filename;
         $loader = new \Twig_Loader_Filesystem(array(dirname($filename), $this->configuration->resolvePath('templates')));
         $auto_reload = true; // TODO: set this in config
-        $this->twig = new \Twig_Environment($loader, array('cache' => $cache, 'dauto_reload' => $auto_reload));
+        $this->twig = new \Twig_Environment($loader, array('cache' => $cache, 'auto_reload' => $auto_reload));
         return true;
     }
 
-- 
GitLab