X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=template.php;h=8e0028bfa4e9937d96c91f3568e404a9289cffc1;hb=13cee08524dc328f40f089631ef9efa1fc13e251;hp=fc7302b2ec81edb5ea6ff159f64e9e119cb7c1ac;hpb=7a16207b28e113674dfc56846c2971086b34cd0e;p=wfpl.git
diff --git a/template.php b/template.php
index fc7302b..8e0028b 100644
--- a/template.php
+++ b/template.php
@@ -209,10 +209,14 @@ function &tem_row_data($tem, $context)
if(count($tem['args'])) {
$auto_func = "tem_auto_" . $tem['args'][0];
- function_exists($auto_func)
- or die("ERROR: template auto function '$auto_func' not found.
\n");
+ if (!function_exists($auto_func)) {
+ die("ERROR: template auto function '$auto_func' not found.
\n");
+ }
+ # NAMESPACIFY $auto_func
+ }
+ if ($auto_func) {
+ $value = $auto_func($scope['data'][$key], $key, $scope, $tem['args']);
}
- if($auto_func) $value = $auto_func($scope['data'][$key], $key, $scope, $tem['args']);
else $value = $scope['data'][$key];
$rows = tem_data_as_rows($value, $key);
@@ -228,8 +232,12 @@ function tem_encoded_data($tag, $context)
$value = tem_get_data($key, $context);
foreach($tag['args'] as $encoding) {
$func = "enc_$encoding";
- if(function_exists($func)) $value = $func($value, $key);
- else die("ERROR: encoder function '$func' not found.
\n");
+ if (function_exists($func)) {
+ # NAMESPACIFY $func
+ $value = $func($value, $key);
+ } else {
+ die("ERROR: encoder function '$func' not found.
\n");
+ }
}
return $value;
}