From 5cd826578914747bf8551ca67933f691fae92ca0 Mon Sep 17 00:00:00 2001 From: Sven Waschkut Date: Fri, 18 Mar 2022 06:32:07 +0100 Subject: [PATCH 1/2] UTIL type=service-merger - class ServiceGroup | bugfix to not delete ServiceGroup members during merge, if this member is available in same name and value at upperlevel --- CHANGELOG.txt | 1 + lib/object-classes/ServiceGroup.php | 19 ++++++++++++------- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 416a3ea5..ec4e1e1a 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -25,6 +25,7 @@ BUGFIX: * UTIL type=device actions=display-shadowrule | bugfix for nat rules * UTIL type=rule actions=exporttoExcel:FILE.html,ResolveScheduleSummary | bugfix to display all type of schedule * class Rule.php methode zonecalculation - bugfix for NAT to +* UTIL type=service-merger - class ServiceGroup | bugfix to not delete ServiceGroup members during merge, if this member is available in same name and value at upperlevel GENERAL: diff --git a/lib/object-classes/ServiceGroup.php b/lib/object-classes/ServiceGroup.php index e41a993e..d12cc391 100644 --- a/lib/object-classes/ServiceGroup.php +++ b/lib/object-classes/ServiceGroup.php @@ -316,16 +316,21 @@ public function replaceReferencedObject($old, $new) if( $pos !== FALSE ) { + while( $pos !== FALSE ) + { + unset($this->members[$pos]); + $pos = array_search($old, $this->members, TRUE); + } + if( $new !== null && !$this->has( $new->name() ) ) { - $this->addMember($new, FALSE); - if( $old->name() == $new->name() ) - $this->removeMember($old, FALSE); - else - $this->removeMember($old); + $this->members[] = $new; + $new->addReference($this); } - else - $this->removeMember($old); + $old->removeReference($this); + + if( $new === null || $new->name() != $old->name() ) + $this->rewriteXML(); return TRUE; } From ffcbaa1e45d86ae0138b8a2bf590e5e23fd7f1bc Mon Sep 17 00:00:00 2001 From: Sven Waschkut Date: Fri, 18 Mar 2022 06:45:23 +0100 Subject: [PATCH 2/2] update framework to version 2.0.33 --- CHANGELOG.txt | 10 +++++++++- lib/misc-classes/PH.php | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index ec4e1e1a..7294712a 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,6 +1,14 @@ CHANGELOG -2.0.32 +2.0.33 +UTILS: + +BUGFIX: + +GENERAL: + + +2.0.32 (20220318) UTILS: * UTIL type=rule | rework 'filter=(service port.counter)' is now 'filter=(service.port.count >,<,=,! COUNT)') * UTIL type=rule | extend actions=exportToExcel with service Counter diff --git a/lib/misc-classes/PH.php b/lib/misc-classes/PH.php index b25e273b..d5f820a0 100644 --- a/lib/misc-classes/PH.php +++ b/lib/misc-classes/PH.php @@ -153,7 +153,7 @@ function __construct($argv, $argc) private static $library_version_major = 2; private static $library_version_sub = 0; - private static $library_version_bugfix = 32; + private static $library_version_bugfix = 33; //BASIC AUTH PAN-OS 7.1 public static $softwareupdate_key = "658d787f293e631196dac9fb29490f1cc1bb3827";