From 9e216ca3e3bb6da77566aa77add6d5e0fdecdf1a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sun, 5 Apr 2009 09:20:12 +0000 Subject: [PATCH] Endless recursive call fixed --- .../main/template/class_BaseTemplateEngine.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/inc/classes/main/template/class_BaseTemplateEngine.php b/inc/classes/main/template/class_BaseTemplateEngine.php index 190e2e80..d6b3a157 100644 --- a/inc/classes/main/template/class_BaseTemplateEngine.php +++ b/inc/classes/main/template/class_BaseTemplateEngine.php @@ -525,15 +525,19 @@ class BaseTemplateEngine extends BaseFrameworkSystem { * Private loader for all template types * * @param $template The template we shall load + * @param $extOther An other extension to use * @return void * @throws FileNotFoundException If the template was not found */ - protected function loadTemplate ($template, $ext = '') { + protected function loadTemplate ($template, $extOther = '') { // Get extension for the template if empty - if (empty($ext)) { + if (empty($extOther)) { // None provided, so get the raw one $ext = $this->getRawTemplateExtension(); - } // END - if + } else { + // Then use it! + $ext = (string) $extOther; + } // Construct the FQFN for the template by honoring the current language $fqfn = sprintf("%s%s%s%s/%s/%s%s", @@ -552,7 +556,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem { $this->loadRawTemplateData($fqfn); } catch (FileNotFoundException $e) { // If we shall load a code-template we need to switch the file extension - if ($this->getTemplateType() != $this->getConfigInstance()->readConfig('web_template_type')) { + if (($this->getTemplateType() != $this->getConfigInstance()->readConfig('web_template_type')) && (empty($extOther))) { // Switch over to the code-template extension and try it again $ext = $this->getCodeTemplateExtension(); -- 2.39.5