X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Ftemplate_processor.php;h=63d75eaa4eda15fb9dfe2a1e3e01a223bf219179;hb=d0bef869dbd8d40f668f631a7875acd18886a464;hp=11769bbd0791bcbf5dccda75ef15666ce7cd0cab;hpb=d8bd4fbb3e38bf0ff9c7b61dba58e20c0d097d75;p=friendica.git diff --git a/include/template_processor.php b/include/template_processor.php index 11769bbd07..63d75eaa4e 100644 --- a/include/template_processor.php +++ b/include/template_processor.php @@ -1,5 +1,6 @@ nodes); return $s; } - + + public function replace($s, $r) { $this->r = $r; $this->search = array(); @@ -171,15 +175,33 @@ // remove comments block $s = preg_replace('/{#[^#]*#}/', "" , $s); - + // replace strings recursively (limit to 10 loops) $os = ""; $count=0; while($os!=$s && $count<10){ $os=$s; $count++; $s = str_replace($this->search,$this->replace, $s); } - return $s; + return template_unescape($s); } } $t = new Template; + + + + +function template_escape($s) { + + return str_replace(array('$','{{'),array('!_Doll^Ars1Az_!','!_DoubLe^BraceS4Rw_!'),$s); + + +} + +function template_unescape($s) { + + return str_replace(array('!_Doll^Ars1Az_!','!_DoubLe^BraceS4Rw_!'),array('$','{{'),$s); + + + +}