From 6fecf93d6fc9af30ca7e40b2b4212ecf225a627f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Sergio=20G=C3=B3mez?= <sergio@uco.es>
Date: Thu, 25 Aug 2016 09:09:26 +0200
Subject: [PATCH] Removed html extension on twig files

---
 lib/SimpleSAML/XHTML/Template.php             | 11 +++++++++--
 templates/{_footer.twig.html => _footer.twig} |  0
 templates/{_header.twig.html => _header.twig} |  0
 templates/{base.twig.html => base.twig}       |  4 ++--
 templates/{index.twig.html => index.twig}     |  2 +-
 templates/{sandbox.twig.html => sandbox.twig} |  2 +-
 6 files changed, 13 insertions(+), 6 deletions(-)
 rename templates/{_footer.twig.html => _footer.twig} (100%)
 rename templates/{_header.twig.html => _header.twig} (100%)
 rename templates/{base.twig.html => base.twig} (87%)
 rename templates/{index.twig.html => index.twig} (98%)
 rename templates/{sandbox.twig.html => sandbox.twig} (88%)

diff --git a/lib/SimpleSAML/XHTML/Template.php b/lib/SimpleSAML/XHTML/Template.php
index 138423c54..b2fa78042 100644
--- a/lib/SimpleSAML/XHTML/Template.php
+++ b/lib/SimpleSAML/XHTML/Template.php
@@ -38,6 +38,13 @@ class SimpleSAML_XHTML_Template
      */
     private $template = 'default.php';
 
+    /**
+     * The template name.
+     *
+     * @var string
+     */
+    private $twig_template;
+
     /*
      * Main Twig namespace, to avoid misspelling it *again*
      */
@@ -70,7 +77,7 @@ class SimpleSAML_XHTML_Template
      */
     private function normalizeTemplateName($templateName)
     {
-        if (strripos($templateName, '.twig.html')) {
+        if (strripos($templateName, '.twig')) {
             return $templateName;
         }
         $phppos = strripos($templateName, '.php');
@@ -81,7 +88,7 @@ class SimpleSAML_XHTML_Template
         if ($tplpos) {
             $templateName = substr($templateName, 0, $tplpos);
         }
-        return $templateName.'.twig.html';
+        return $templateName.'.twig';
     }
 
 
diff --git a/templates/_footer.twig.html b/templates/_footer.twig
similarity index 100%
rename from templates/_footer.twig.html
rename to templates/_footer.twig
diff --git a/templates/_header.twig.html b/templates/_header.twig
similarity index 100%
rename from templates/_header.twig.html
rename to templates/_header.twig
diff --git a/templates/base.twig.html b/templates/base.twig
similarity index 87%
rename from templates/base.twig.html
rename to templates/base.twig
index ad30a6335..6274c301e 100644
--- a/templates/base.twig.html
+++ b/templates/base.twig
@@ -15,14 +15,14 @@
 <body>
     <div id="wrap">
 
-        {% block header %}{% include "_header.twig.html" %}{% endblock %}
+        {% block header %}{% include "_header.twig" %}{% endblock %}
 
         <div id="content">
             {% block content %}{% endblock %}
         </div><!-- #content -->
 
         <div id="footer">
-            {% block footer %}{% include "_footer.twig.html" %}{% endblock %}
+            {% block footer %}{% include "_footer.twig" %}{% endblock %}
         </div>
 
     </div><!-- #wrap -->
diff --git a/templates/index.twig.html b/templates/index.twig
similarity index 98%
rename from templates/index.twig.html
rename to templates/index.twig
index c88893418..2a6004aa0 100644
--- a/templates/index.twig.html
+++ b/templates/index.twig
@@ -1,4 +1,4 @@
-{% extends "base.twig.html" %}
+{% extends "base.twig" %}
 {% block content %}
     <div id="portalmenu" class="ui-tabs ui-widget ui-widget-content ui-corner-all">
         <ul class="tabset_tabs ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all">
diff --git a/templates/sandbox.twig.html b/templates/sandbox.twig
similarity index 88%
rename from templates/sandbox.twig.html
rename to templates/sandbox.twig
index e37201e0c..0d42e5e16 100644
--- a/templates/sandbox.twig.html
+++ b/templates/sandbox.twig
@@ -1,4 +1,4 @@
-{% extends "base.twig.html" %}
+{% extends "base.twig" %}
 {% block content %}
     <p>This page exists as a sandbox to play with twig without affecting anything else. The template is in ./templates.</p>
     <p>{{ sometext }}</p>
-- 
GitLab