fix: [sync] prevent local tags from being pulled

pull/7100/head
Golbark 2021-02-26 09:59:57 +01:00
parent 38f785ea63
commit 14b9463fb5
1 changed files with 24 additions and 0 deletions

View File

@ -286,6 +286,14 @@ class Server extends AppModel
$event['Event']['distribution'] = '1';
break;
}
// We remove local tags obtained via pull
if (isset($event['Event']['Tag'])) {
foreach ($event['Event']['Tag'] as $key => $a) {
if ($a['local']) {
unset($event['Event']['Tag'][$key]);
}
}
}
if (isset($event['Event']['Attribute']) && !empty($event['Event']['Attribute'])) {
foreach ($event['Event']['Attribute'] as $key => $a) {
switch ($a['distribution']) {
@ -296,6 +304,14 @@ class Server extends AppModel
$event['Event']['Attribute'][$key]['distribution'] = '1';
break;
}
// We remove local tags obtained via pull
if (isset($a['Tag'])) {
foreach ($a['Tag'] as $k => $v) {
if ($v['local']) {
unset($event['Event']['Attribute'][$key]['Tag'][$k]);
}
}
}
}
}
if (isset($event['Event']['Object']) && !empty($event['Event']['Object'])) {
@ -318,6 +334,14 @@ class Server extends AppModel
$event['Event']['Object'][$i]['Attribute'][$j]['distribution'] = '1';
break;
}
// We remove local tags obtained via pull
if (isset($a['Tag'])) {
foreach ($a['Tag'] as $k => $v) {
if ($v['local']) {
unset($event['Event']['Object'][$i]['Attribute'][$j]['Tag'][$k]);
}
}
}
}
}
}