mirror of
https://github.com/Icinga/icingaweb2-module-businessprocess.git
synced 2026-01-10 23:22:53 -05:00
parent
cad29d4d32
commit
c5d3127303
2 changed files with 6 additions and 3 deletions
|
|
@ -301,7 +301,7 @@ class LegacyConfigParser
|
|||
}
|
||||
|
||||
$op = '&';
|
||||
if (preg_match_all('~([\|\+&\!])~', $value, $m)) {
|
||||
if (preg_match_all('~(?<!\\\\)([\|\+&\!])~', $value, $m)) {
|
||||
$op = implode('', $m[1]);
|
||||
for ($i = 1; $i < strlen($op); $i++) {
|
||||
if ($op[$i] !== $op[$i - 1]) {
|
||||
|
|
@ -328,8 +328,9 @@ class LegacyConfigParser
|
|||
));
|
||||
$node->setBpConfig($bp);
|
||||
|
||||
$cmps = preg_split('~\s*\\' . $op . '\s*~', $value, -1, PREG_SPLIT_NO_EMPTY);
|
||||
$cmps = preg_split('~\s*(?<!\\\\)\\' . $op . '\s*~', $value, -1, PREG_SPLIT_NO_EMPTY);
|
||||
foreach ($cmps as $val) {
|
||||
$val = preg_replace('~(\\\\([\|\+&\!]))~', '$2', $val);
|
||||
if (strpos($val, ';') !== false) {
|
||||
if ($bp->hasNode($val)) {
|
||||
$node->addChild($bp->getNode($val));
|
||||
|
|
|
|||
|
|
@ -184,7 +184,9 @@ class LegacyConfigRenderer
|
|||
{
|
||||
$op = static::renderOperator($node);
|
||||
$children = $node->getChildNames();
|
||||
$str = implode(' ' . $op . ' ', $children);
|
||||
$str = implode(' ' . $op . ' ', array_map(function ($val) {
|
||||
return preg_replace('~([\|\+&\!])~', '\\\\$1', $val);
|
||||
}, $children));
|
||||
|
||||
if ((count($children) < 2) && $op !== '&') {
|
||||
return $op . ' ' . $str;
|
||||
|
|
|
|||
Loading…
Reference in a new issue