From 06cbe1f0b01cc96bf6f9362161dc7b5b9600b776 Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Fri, 9 Oct 2015 09:07:50 +0000 Subject: [PATCH] Allow custom fields in IF placeholders --- etemplate/inc/class.bo_merge.inc.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/etemplate/inc/class.bo_merge.inc.php b/etemplate/inc/class.bo_merge.inc.php index 38da7b7fe3..abb0844acb 100644 --- a/etemplate/inc/class.bo_merge.inc.php +++ b/etemplate/inc/class.bo_merge.inc.php @@ -1328,19 +1328,19 @@ abstract class bo_merge if (strpos($content,'$$IF') !== false) { //Example use to use: $$IF n_prefix~Herr~Sehr geehrter~Sehr geehrte$$ $this->replacements =& $replacements; - $content = preg_replace_callback('/\$\$IF ([0-9a-z_\/-]+)~(.*)~(.*)~(.*)\$\$/imU',Array($this,'replace_callback'),$content); + $content = preg_replace_callback('/\$\$IF ([#0-9a-z_\/-]+)~(.*)~(.*)~(.*)\$\$/imU',Array($this,'replace_callback'),$content); unset($this->replacements); } if (strpos($content,'$$NELF') !== false) { //Example: $$NEPBR org_unit$$ sets a LF and value of org_unit, only if there is a value $this->replacements =& $replacements; - $content = preg_replace_callback('/\$\$NELF ([0-9a-z_\/-]+)\$\$/imU',Array($this,'replace_callback'),$content); + $content = preg_replace_callback('/\$\$NELF ([#0-9a-z_\/-]+)\$\$/imU',Array($this,'replace_callback'),$content); unset($this->replacements); } if (strpos($content,'$$NENVLF') !== false) { //Example: $$NEPBRNV org_unit$$ sets only a LF if there is a value for org_units, but did not add any value $this->replacements =& $replacements; - $content = preg_replace_callback('/\$\$NENVLF ([0-9a-z_\/-]+)\$\$/imU',Array($this,'replace_callback'),$content); + $content = preg_replace_callback('/\$\$NENVLF ([#0-9a-z_\/-]+)\$\$/imU',Array($this,'replace_callback'),$content); unset($this->replacements); } if (strpos($content,'$$LETTERPREFIX$$') !== false) @@ -1351,7 +1351,7 @@ abstract class bo_merge if (strpos($content,'$$LETTERPREFIXCUSTOM') !== false) { //Example use to use for a custom Letter Prefix: $$LETTERPREFIX n_prefix title n_family$$ $this->replacements =& $replacements; - $content = preg_replace_callback('/\$\$LETTERPREFIXCUSTOM ([0-9a-z_-]+)(.*)\$\$/imU',Array($this,'replace_callback'),$content); + $content = preg_replace_callback('/\$\$LETTERPREFIXCUSTOM ([#0-9a-z_-]+)(.*)\$\$/imU',Array($this,'replace_callback'),$content); unset($this->replacements); } return $content;