aboutsummaryrefslogtreecommitdiffstats
path: root/include/template_processor.php
diff options
context:
space:
mode:
Diffstat (limited to 'include/template_processor.php')
-rw-r--r--include/template_processor.php16
1 files changed, 11 insertions, 5 deletions
diff --git a/include/template_processor.php b/include/template_processor.php
index 83f680f02..11769bbd0 100644
--- a/include/template_processor.php
+++ b/include/template_processor.php
@@ -11,15 +11,18 @@
private function _preg_error(){
switch(preg_last_error()){
- case PREG_INTERNAL_ERROR: die('PREG_INTERNAL_ERROR'); break;
- case PREG_BACKTRACK_LIMIT_ERROR: die('PREG_BACKTRACK_LIMIT_ERROR'); break;
- case PREG_RECURSION_LIMIT_ERROR: die('PREG_RECURSION_LIMIT_ERROR'); break;
- case PREG_BAD_UTF8_ERROR: die('PREG_BAD_UTF8_ERROR'); break;
- case PREG_BAD_UTF8_OFFSET_ERROR: die('PREG_BAD_UTF8_OFFSET_ERROR'); break;
+ case PREG_INTERNAL_ERROR: echo('PREG_INTERNAL_ERROR'); break;
+ case PREG_BACKTRACK_LIMIT_ERROR: echo('PREG_BACKTRACK_LIMIT_ERROR'); break;
+ case PREG_RECURSION_LIMIT_ERROR: echo('PREG_RECURSION_LIMIT_ERROR'); break;
+ case PREG_BAD_UTF8_ERROR: echo('PREG_BAD_UTF8_ERROR'); break;
+ case PREG_BAD_UTF8_OFFSET_ERROR: echo('PREG_BAD_UTF8_OFFSET_ERROR'); break;
default:
//die("Unknown preg error.");
return;
}
+ echo "<hr><pre>";
+ debug_print_backtrace();
+ die();
}
private function _build_replace($r, $prefix){
@@ -166,6 +169,9 @@
$s = preg_replace_callback('/\|\|([0-9]+)\|\|/', array($this, "_replcb_node"), $s);
if ($s==Null) $this->_preg_error();
+ // remove comments block
+ $s = preg_replace('/{#[^#]*#}/', "" , $s);
+
// replace strings recursively (limit to 10 loops)
$os = ""; $count=0;
while($os!=$s && $count<10){