From 1ae125f08eb6e30e726fd67ae4328c3fe0849b97 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Wed, 29 Apr 2015 21:40:12 +0000 Subject: [PATCH] Handle escaped curly bracket placeholders in rtf --- etemplate/inc/class.bo_merge.inc.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/etemplate/inc/class.bo_merge.inc.php b/etemplate/inc/class.bo_merge.inc.php index 916939f45d..340966d3f9 100644 --- a/etemplate/inc/class.bo_merge.inc.php +++ b/etemplate/inc/class.bo_merge.inc.php @@ -682,6 +682,12 @@ abstract class bo_merge // agressivly removing all xml-tags eg. Word adds within placeholders $content = preg_replace_callback('/{{[^}]+}}/i',create_function('$p','return \'$$\'.strip_tags(substr($p[0],2,-2)).\'$$\';'),$content); + // Handle escaped placeholder markers in RTF, they won't match when escaped + if($mimetype == 'application/rtf') + { + $content = preg_replace('/\\\{\\\{([^\\}]+)\\\}\\\}/i','$$\1$$',$content); + } + // make currently processed mimetype available to class methods; $this->mimetype = $mimetype;