From 37dfe0e6efd29ef12284d7431aa7d16c8786ab19 Mon Sep 17 00:00:00 2001 From: Daniel Rudolf Date: Sat, 25 Nov 2017 21:52:03 +0100 Subject: [PATCH] Force themes to use .twig as file extension We recommend plugin developers to use templates when serving HTML contents (like the UI of PicoAdmin), however, by supporting multiple file extensions for themes, we make it pretty hard to overwrite a plugin's template with a theme. As always, we preserve BC using PicoDeprecated. --- lib/Pico.php | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/lib/Pico.php b/lib/Pico.php index a03a627..f2ae45a 100644 --- a/lib/Pico.php +++ b/lib/Pico.php @@ -1991,14 +1991,7 @@ class Pico protected function getTwigTemplate() { $templateName = !empty($this->meta['template']) ? $this->meta['template'] : 'index'; - - if (file_exists($this->getThemesDir() . $this->getConfig('theme') . '/' . $templateName . '.twig')) { - $templateName .= '.twig'; - } else { - $templateName .= '.html'; - } - - return $templateName; + return $templateName . '.twig'; } /**