X-Git-Url: https://jasonwoof.com/gitweb/?p=wfpl.git;a=blobdiff_plain;f=template.php;h=fa0affbe3268535879395d2c8bf2402049784542;hp=7539a19dcb387b89c02f40eb5c1119f94dbf2514;hb=26bad7e66d87374bed4f126c7f202133828e387c;hpb=003188abd258a3f19d3a5ab08c3a08a848b45660 diff --git a/template.php b/template.php index 7539a19..fa0affb 100644 --- a/template.php +++ b/template.php @@ -248,11 +248,11 @@ function tem_encoded_data($tag, $context) function is_sub_template(&$piece) { - return is_array($piece) and $piece['pieces']; + return is_array($piece) && isset($piece['pieces']); } function is_value_slot(&$piece) { - return is_array($piece) and !$piece['pieces']; + return is_array($piece) && !isset($piece['pieces']); } # Return a hash containing the top-level sub-templates of tem. @@ -457,6 +457,9 @@ class tem { } function append($key, $value) { + if (!isset($this->data[$key])) { + $this->data[$key] = ''; + } $this->data[$key] .= $value; } @@ -475,6 +478,9 @@ class tem { function show($name) { $tem = tem_is_old_sub($name, $this->template); if($tem) { + if (!isset($this->data[$name])) { + $this->data[$name] = ''; + } $this->data[$name] .= fill_template($tem, $this->data); } }