From: Roland Häder Date: Sun, 5 Apr 2009 09:20:12 +0000 (+0000) Subject: Endless recursive call fixed X-Git-Url: https://git.mxchange.org/?p=core.git;a=commitdiff_plain;h=9e216ca3e3bb6da77566aa77add6d5e0fdecdf1a Endless recursive call fixed --- 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();