JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
tem_show() fails quietly when the template section is missing
[wfpl.git] / template.php
index 6aba82b..1667cde 100644 (file)
@@ -349,6 +349,7 @@ function &tem_is_old_sub($name, &$template) {
                        if($tem) return $tem;
                }
        }
+       return false;
 }
 
 class tem {
@@ -356,7 +357,7 @@ class tem {
        var $data; 
 
        function tem() {
-               $this->template = array();
+               $this->template = array('pieces' => array());
                $this->data = array();
        }
        
@@ -382,7 +383,9 @@ class tem {
 
        function show($name) {
                $tem = tem_is_old_sub($name, $this->template);
-               $this->data[$name] .= fill_template($tem, $this->data);
+               if($tem) {
+                       $this->data[$name] .= fill_template($tem, $this->data);
+               }
        }
 
        function show_separated($name) {