X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Ftemplate_processor.php;h=27271e2edbded66d9166af2b92203de46e72a95d;hb=6e981ed798f8938ce7f0de91d523b1ba6359381c;hp=6c5908d92e8d8f1d1c5f318bb868c3c6199d1f55;hpb=71751ecb8c141fe5544a32e175fc0a45165206d2;p=friendica.git diff --git a/include/template_processor.php b/include/template_processor.php index 6c5908d92e..27271e2edb 100644 --- a/include/template_processor.php +++ b/include/template_processor.php @@ -1,9 +1,16 @@ r = $r; + // remove comments block + $s = preg_replace('/{#(.*?\s*?)*?#}/', "", $s); + $s = $this->_build_nodes($s); $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; @@ -276,12 +284,18 @@ class Template { $count++; $s = $this->var_replace($s); } - return $s; + return template_unescape($s); } - + + public function get_template_file($file, $root='') { + $a = get_app(); + $template_file = get_template_file($a, $file, $root); + $content = file_get_contents($template_file); + return $content; + } + } -$t = new Template; function template_escape($s) {