- // Do the replacement
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'template='.$GLOBALS['current_template']);
- $replacer = '{DQUOTE} . doTemplate' . $data['callback'] . "('" . $GLOBALS['current_template'] . "', true";
-
- // Is 'value' set?
- if (!empty($data['value'])) {
- // Then include it as well
- $replacer .= ", '" . $data['value'] . "'";
- } // END - if
-
- // Replacer is ready
- $replacer .= ') . {DQUOTE}';
+ // Construct call-back function name
+ $callback = 'doTemplate' . $data['callback'];
+
+ // Init replacer
+ $replacer = '<!-- [' . __FUNCTION__ . ':' . __LINE__.'] Call-back function ' . $callback . ' does not exist. //-->';
+
+ // Is the function there?
+ if (function_exists($callback)) {
+ // Do the replacement
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'template='.$GLOBALS['current_template']);
+ $replacer = '{DQUOTE} . ' . $callback . "('" . $GLOBALS['current_template'] . "', true";
+
+ // Is 'value' set?
+ if (!empty($data['value'])) {
+ // Then include it as well
+ $replacer .= ", '" . $data['value'] . "'";
+ } // END - if
+
+ // Replacer is ready
+ $replacer .= ') . {DQUOTE}';
+ } else {
+ // Log missing function
+ logDebugMessage(__FUNCTION__, __LINE__, 'Call-back function ' . $callback . ' does not exist.');
+ }