Explorar o código

Fix potential problem where parsers array is not initialized when template string is parsed

Nathaniel van Diepen %!s(int64=7) %!d(string=hai) anos
pai
achega
55077031cd
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  1. 4 0
      Data/template.class.php

+ 4 - 0
Data/template.class.php

@@ -273,6 +273,10 @@
 			return $output;
 		}
 		public static function parse(string $template, $data) : string{
+			if(is_null(static::$parsers)){
+				// Force parsers to be added
+				new Template(uuid(), $template);
+			}
 			$ignored = [];
 			$output = $template;
 			// Handle {#ignore code}