Skip to content

Commit

Permalink
Fix PHP 8.2 deprecation warnings caused by shapes on automaps and hos…
Browse files Browse the repository at this point in the history
…t alias

fixes #357
  • Loading branch information
LarsMichelsen committed Oct 14, 2023
1 parent ac2570d commit 701e7d4
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
1 change: 1 addition & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
1.9.38
Frontend:
* FIX: Fix XSS vulnerability
* FIX: Fix PHP 8.2 deprecation warnings caused by shapes on automaps and host alias
* FIX: Fix PHP 8.2 deprecation warnings caused by gettext.inc
* FIX: Fix PHP 8.2 deprecation warnings caused by std_speedometer gadget

Expand Down
1 change: 1 addition & 0 deletions share/server/core/classes/objects/NagVisHost.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class NagVisHost extends NagVisStatefulObject {
protected static $langServices = null;

protected $host_name;
protected $alias;

protected $members = array();

Expand Down
1 change: 1 addition & 0 deletions share/server/core/classes/objects/NagVisShape.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
class NagVisShape extends NagVisStatelessObject {
protected $enable_refresh;
protected $icon;
protected $icon_size;

/**
* Class constructor
Expand Down
14 changes: 9 additions & 5 deletions share/server/core/sources/automap.php
Original file line number Diff line number Diff line change
Expand Up @@ -378,12 +378,12 @@ function automap_obj($MAPCFG, &$params, &$saved_config, $obj_name) {

$obj['.width'] = $w;
$obj['.height'] = $h;
}

$obj['label_show'] = $MAPCFG->getValue(0, 'label_show');
$obj['label_border'] = $MAPCFG->getValue(0, 'label_border');
$obj['label_background'] = $MAPCFG->getValue(0, 'label_background');
$obj['label_maxlen'] = $MAPCFG->getValue(0, 'label_maxlen');
$obj['label_show'] = $MAPCFG->getValue(0, 'label_show');
$obj['label_border'] = $MAPCFG->getValue(0, 'label_border');
$obj['label_background'] = $MAPCFG->getValue(0, 'label_background');
$obj['label_maxlen'] = $MAPCFG->getValue(0, 'label_maxlen');
}

// Header menu has z-index 100, this object's label the below+1
$obj['z'] = 98;
Expand Down Expand Up @@ -610,6 +610,10 @@ function automap_tree_to_map_config($MAPCFG, &$params, &$saved_config, &$map_con
}

$map_config[$tree['object_id']] = $tree;

// Remove automap internal attribute from <<<monitoring>>> node
if ($map_config[$tree['object_id']]['type'] == 'shape')
unset($map_config[$tree['object_id']]['host_name']);

// Remove internal attributes here
unset($map_config[$tree['object_id']]['.childs']);
Expand Down

0 comments on commit 701e7d4

Please sign in to comment.