From dc48cc0a7983c3413d58c1afbcf04ab03eccf75c Mon Sep 17 00:00:00 2001 From: Ankit Agarwal Date: Tue, 15 Nov 2016 13:34:52 +0530 Subject: [PATCH] MDL-56911 themes: Resolve settings before calling parser --- lib/outputlib.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/outputlib.php b/lib/outputlib.php index dc40d2bdc65..4e5e58ec084 100644 --- a/lib/outputlib.php +++ b/lib/outputlib.php @@ -1513,6 +1513,13 @@ class theme_config { } } + // Now resolve all theme settings or do any other postprocessing. + // This needs to be done before calling core parser, since the parser strips [[settings]] tags. + $csspostprocess = $this->csspostprocess; + if (function_exists($csspostprocess)) { + $css = $csspostprocess($css, $this); + } + // Post processing using an object representation of CSS. $hastreeprocessor = !empty($this->csstreepostprocessor) && function_exists($this->csstreepostprocessor); $needsparsing = $hastreeprocessor || !empty($this->rtlmode); @@ -1534,12 +1541,6 @@ class theme_config { unset($csstree); } - // now resolve all theme settings or do any other postprocessing - $csspostprocess = $this->csspostprocess; - if (function_exists($csspostprocess)) { - $css = $csspostprocess($css, $this); - } - return $css; }