mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-29 01:59:39 +01:00
Accept and process commands even if they're right at the beginning.
Fixes bug where commands at the start of content were not processed.
This commit is contained in:
parent
eddc291b4c
commit
0516bf5f59
@ -1324,30 +1324,30 @@ abstract class bo_merge
|
|||||||
*/
|
*/
|
||||||
private function process_commands($content, $replacements)
|
private function process_commands($content, $replacements)
|
||||||
{
|
{
|
||||||
if (strpos($content,'$$IF'))
|
if (strpos($content,'$$IF') !== false)
|
||||||
{ //Example use to use: $$IF n_prefix~Herr~Sehr geehrter~Sehr geehrte$$
|
{ //Example use to use: $$IF n_prefix~Herr~Sehr geehrter~Sehr geehrte$$
|
||||||
$this->replacements =& $replacements;
|
$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);
|
unset($this->replacements);
|
||||||
}
|
}
|
||||||
if (strpos($content,'$$NELF'))
|
if (strpos($content,'$$NELF') !== false)
|
||||||
{ //Example: $$NEPBR org_unit$$ sets a LF and value of org_unit, only if there is a value
|
{ //Example: $$NEPBR org_unit$$ sets a LF and value of org_unit, only if there is a value
|
||||||
$this->replacements =& $replacements;
|
$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);
|
unset($this->replacements);
|
||||||
}
|
}
|
||||||
if (strpos($content,'$$NENVLF'))
|
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
|
{ //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;
|
$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);
|
unset($this->replacements);
|
||||||
}
|
}
|
||||||
if (strpos($content,'$$LETTERPREFIX$$'))
|
if (strpos($content,'$$LETTERPREFIX$$') !== false)
|
||||||
{ //Example use to use: $$LETTERPREFIX$$
|
{ //Example use to use: $$LETTERPREFIX$$
|
||||||
$LETTERPREFIXCUSTOM = '$$LETTERPREFIXCUSTOM n_prefix title n_family$$';
|
$LETTERPREFIXCUSTOM = '$$LETTERPREFIXCUSTOM n_prefix title n_family$$';
|
||||||
$content = str_replace('$$LETTERPREFIX$$',$LETTERPREFIXCUSTOM,$content);
|
$content = str_replace('$$LETTERPREFIX$$',$LETTERPREFIXCUSTOM,$content);
|
||||||
}
|
}
|
||||||
if (strpos($content,'$$LETTERPREFIXCUSTOM'))
|
if (strpos($content,'$$LETTERPREFIXCUSTOM') !== false)
|
||||||
{ //Example use to use for a custom Letter Prefix: $$LETTERPREFIX n_prefix title n_family$$
|
{ //Example use to use for a custom Letter Prefix: $$LETTERPREFIX n_prefix title n_family$$
|
||||||
$this->replacements =& $replacements;
|
$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);
|
||||||
|
Loading…
Reference in New Issue
Block a user