MDL-66384 core: Limit explode to allow subdirs in template names
authorAndrew Nicols <andrew@nicols.co.uk>
Tue, 13 Aug 2019 03:29:26 +0000 (11:29 +0800)
committerAndrew Nicols <andrew@nicols.co.uk>
Tue, 13 Aug 2019 03:29:40 +0000 (11:29 +0800)
lib/classes/output/mustache_template_source_loader.php

index 22cde76..bae56d6 100644 (file)
@@ -308,11 +308,11 @@ class mustache_template_source_loader {
             if ($name) {
                 switch ($type) {
                     case Mustache_Tokenizer::T_PARTIAL:
-                        list($component, $id) = explode('/', $name);
+                        list($component, $id) = explode('/', $name, 2);
                         $templates = $addtodependencies($templates, $component, $id);
                         break;
                     case Mustache_Tokenizer::T_PARENT:
-                        list($component, $id) = explode('/', $name);
+                        list($component, $id) = explode('/', $name, 2);
                         $templates = $addtodependencies($templates, $component, $id);
                         break;
                     case Mustache_Tokenizer::T_SECTION: