Skip to content

Commit

Permalink
Compatiblity changes for Boost under PHP 8.1 (#5338)
Browse files Browse the repository at this point in the history
Closes #5338
  • Loading branch information
netniV committed Jun 3, 2023
1 parent 6bfd783 commit 95bb1f9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Cacti CHANGELOG

1.2.25
-SECURITY#5318: Multiple minor stored XSS vulnerabilities in Cacti 1.2.24
-issue#2959: Multi-threaded cli/rebuild_poller_cache.php, deprecated push_out_hosts.php
-issue#2959: Multi-threaded cli/rebuild_poller_cache.php, deprecated push_out_hosts.php
-issue#5254: Created a data source template to specify the snmp port, but it doesn't seem to work properly
-issue#5255: Data query xml path with space problem
-issue#5258: Warnings occur when installing thold plugin and as such thold will not upgrade correctly
Expand All @@ -22,6 +22,7 @@ Cacti CHANGELOG
-issue#5317: Data Source Info Mode produces invalid recommendations
-issue#5319: Data Source Debug 'Run All' generates too many log messages
-issue#5323: Cosmetic error in the system utilities - rebuild poller cache - description
-issue#5338:
-feature: Upgrade billboard.js to version 3.7.4
-feature: Upgrade d3.js to version 7.8.2

Expand Down
7 changes: 5 additions & 2 deletions poller_boost.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,14 +119,14 @@
/* find out if it's time to collect device information
* support both old and new formats.
*/
$boost_last_run_time = read_config_option('boost_last_run_time');
$boost_last_run_time = read_config_option('boost_last_run_time') ?? '';
if (!is_numeric($boost_last_run_time)) {
$last_run_time = strtotime($boost_last_run_time);
} else {
$last_run_time = $boost_last_run_time;
}

$boost_next_run_time = read_config_option('boost_next_run_time');
$boost_next_run_time = read_config_option('boost_next_run_time') ?? '';
if (!is_numeric($boost_next_run_time)) {
$next_run_time = strtotime($boost_next_run_time);
} else {
Expand Down Expand Up @@ -308,6 +308,9 @@ function boost_prepare_process_table() {
boost_debug('Parallel Process Setup Begins.');

$boost_poller_status = read_config_option('boost_poller_status');
if (!$boost_poller_status) [
$boost_poller_status = 'not started';
]

/* detect a process that has overrun it's warning time */
if (substr_count($boost_poller_status, 'running')) {
Expand Down

1 comment on commit 95bb1f9

@TheWitness
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this work in older PHP's?

Please sign in to comment.