Remove array element in cached mode
authorRoland Häder <roland@mxchange.org>
Fri, 28 Dec 2012 22:35:28 +0000 (22:35 +0000)
committerRoland Häder <roland@mxchange.org>
Fri, 28 Dec 2012 22:35:28 +0000 (22:35 +0000)
inc/template-functions.php

index dc13d3e1b95e30d8ae7aaab5dcd45c0c7e74afd1..c05eb5d06247b10892638aacacc58c9e17e1904a 100644 (file)
@@ -304,6 +304,9 @@ function loadTemplate ($template, $return = FALSE, $content = array(), $compileC
        if ((!isDebugTemplateCacheEnabled()) && (isTemplateCached('html', $template))) {
                // Evaluate the cache
                $templateContent = readTemplateCache('html', $template, $content);
+
+               // Better remove array element which is only needed in uncached mode
+               unset($GLOBALS['template_eval']['html'][$template]);
        } elseif (!isset($GLOBALS['template_eval']['html'][$template])) {
                // Make all template names lowercase
                $template = strtolower($template);
@@ -491,6 +494,9 @@ function loadEmailTemplate ($template, $content = array(), $userid = NULL, $load
        if ((!isDebugTemplateCacheEnabled()) && (isTemplateCached('email', $template))) {
                // Evaluate the cache
                $templateContent = readTemplateCache('email', $template, $content);
+
+               // Better remove array element which is need only in uncached mode
+               unset($GLOBALS['template_eval']['email'][$template]);
        } elseif (!isset($GLOBALS['template_eval']['email'][$template])) {
                // Base directory
                $basePath = sprintf("%stemplates/%s/emails/", getPath(), getLanguage());