-
Notifications
You must be signed in to change notification settings - Fork 4
refactor: safe PHP 7.4 modernization #54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from 4 commits
16b2a62
5eb305d
52c7097
894deb6
139f88d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| { | ||
| "session_id": "0ad57977-0b9b-4712-bf0c-d8591161a6c5", | ||
| "ended_at": "2026-04-09T20:58:25.835Z", | ||
| "reason": "other", | ||
| "agents_spawned": 0, | ||
| "agents_completed": 0, | ||
| "modes_used": [] | ||
| } | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,8 @@ | ||||||||||||||||||
| { | ||||||||||||||||||
| "session_id": "426d31d2-5007-4a69-94e9-7171c89be435", | ||||||||||||||||||
| "ended_at": "2026-04-09T20:39:23.599Z", | ||||||||||||||||||
| "reason": "other", | ||||||||||||||||||
| "agents_spawned": 0, | ||||||||||||||||||
| "agents_completed": 0, | ||||||||||||||||||
| "modes_used": [] | ||||||||||||||||||
| } | ||||||||||||||||||
|
||||||||||||||||||
| { | |
| "session_id": "426d31d2-5007-4a69-94e9-7171c89be435", | |
| "ended_at": "2026-04-09T20:39:23.599Z", | |
| "reason": "other", | |
| "agents_spawned": 0, | |
| "agents_completed": 0, | |
| "modes_used": [] | |
| } |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,8 @@ | ||||||||||||||||||
| { | ||||||||||||||||||
| "session_id": "865e7e69-4115-4c88-a9ea-8264b75b1cfc", | ||||||||||||||||||
| "ended_at": "2026-04-09T20:42:25.246Z", | ||||||||||||||||||
| "reason": "other", | ||||||||||||||||||
| "agents_spawned": 0, | ||||||||||||||||||
| "agents_completed": 0, | ||||||||||||||||||
| "modes_used": [] | ||||||||||||||||||
| } | ||||||||||||||||||
|
||||||||||||||||||
| { | |
| "session_id": "865e7e69-4115-4c88-a9ea-8264b75b1cfc", | |
| "ended_at": "2026-04-09T20:42:25.246Z", | |
| "reason": "other", | |
| "agents_spawned": 0, | |
| "agents_completed": 0, | |
| "modes_used": [] | |
| } |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,8 @@ | ||||||||||||||||||
| { | ||||||||||||||||||
| "session_id": "d67358a1-81fd-4c38-8750-7175bf018252", | ||||||||||||||||||
| "ended_at": "2026-04-09T20:46:21.611Z", | ||||||||||||||||||
| "reason": "other", | ||||||||||||||||||
| "agents_spawned": 0, | ||||||||||||||||||
| "agents_completed": 0, | ||||||||||||||||||
| "modes_used": [] | ||||||||||||||||||
| } | ||||||||||||||||||
|
||||||||||||||||||
| { | |
| "session_id": "d67358a1-81fd-4c38-8750-7175bf018252", | |
| "ended_at": "2026-04-09T20:46:21.611Z", | |
| "reason": "other", | |
| "agents_spawned": 0, | |
| "agents_completed": 0, | |
| "modes_used": [] | |
| } |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,8 @@ | ||||||||||||||||||
| { | ||||||||||||||||||
| "session_id": "e795e842-5b52-4c4f-a301-d0c076c145ec", | ||||||||||||||||||
| "ended_at": "2026-04-09T20:40:09.532Z", | ||||||||||||||||||
| "reason": "other", | ||||||||||||||||||
| "agents_spawned": 0, | ||||||||||||||||||
| "agents_completed": 0, | ||||||||||||||||||
| "modes_used": [] | ||||||||||||||||||
| } | ||||||||||||||||||
|
||||||||||||||||||
| { | |
| "session_id": "e795e842-5b52-4c4f-a301-d0c076c145ec", | |
| "ended_at": "2026-04-09T20:40:09.532Z", | |
| "reason": "other", | |
| "agents_spawned": 0, | |
| "agents_completed": 0, | |
| "modes_used": [] | |
| } |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,4 +1,6 @@ | ||||||
| <?php | ||||||
|
|
||||||
| declare(strict_types=1); | ||||||
| /* | ||||||
| +-------------------------------------------------------------------------+ | ||||||
| | Copyright (C) 2004-2026 The Cacti Group | | ||||||
|
|
@@ -61,7 +63,7 @@ | |||||
| } elseif (cacti_sizeof($data)) { | ||||||
| $attribs = json_decode($data['post']); | ||||||
|
|
||||||
| $nattribs = array(); | ||||||
| $nattribs = []; | ||||||
| foreach($attribs as $field => $content) { | ||||||
| $nattribs[$field] = $content; | ||||||
| } | ||||||
|
|
@@ -97,7 +99,7 @@ | |||||
| $output .= ($output != '' ? '</tr>':'') . '<tr>'; | ||||||
| } | ||||||
|
|
||||||
| if (is_array($content)) { | ||||||
| if (is_[$content]) { | ||||||
|
||||||
| if (is_[$content]) { | |
| if (is_array($content)) { |
Copilot
AI
Apr 9, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This condition is syntactically invalid: is_[$value] will cause a PHP parse error during CSV export. It appears the intent was to keep the prior is_array($value) check.
| if (is_[$value]) { | |
| if (is_array($value)) { |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,7 +1,14 @@ | ||||||
| <?php | ||||||
|
|
||||||
| declare(strict_types=1); | ||||||
|
|
||||||
| function audit_process_page_data($page, $drop_action, $selected_items) { | ||||||
| $objects = array(); | ||||||
| $objects = []; | ||||||
|
|
||||||
| if (!is_string($page) || $page === '' || !is_[$selected_items]) { | ||||||
|
||||||
| if (!is_string($page) || $page === '' || !is_[$selected_items]) { | |
| if (!is_string($page) || $page === '' || !is_array($selected_items)) { |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,4 +1,6 @@ | ||||||
| <?php | ||||||
|
|
||||||
| declare(strict_types=1); | ||||||
| /* | ||||||
| +-------------------------------------------------------------------------+ | ||||||
| | Copyright (C) 2004-2026 The Cacti Group | | ||||||
|
|
@@ -67,7 +69,7 @@ function audit_check_upgrade() { | |||||
| include_once($config['library_path'] . '/database.php'); | ||||||
| include_once($config['library_path'] . '/functions.php'); | ||||||
|
|
||||||
| $files = array('plugins.php', 'audit.php'); | ||||||
| $files = ['plugins.php', 'audit.php']; | ||||||
| if (isset($_SERVER['PHP_SELF']) && !in_array(basename($_SERVER['PHP_SELF']), $files)) { | ||||||
| return; | ||||||
| } | ||||||
|
|
@@ -228,7 +230,7 @@ function audit_log_valid_event() { | |||||
| return $valid; | ||||||
| } | ||||||
|
|
||||||
| function audit_utilities_array() { | ||||||
| function audit_utilities_[] { | ||||||
|
||||||
| function audit_utilities_[] { | |
| function audit_utilities_array() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This
.omc/sessions/*.jsonfile appears to be an editor/automation session artifact, not part of the plugin runtime. It should not be committed; please remove it from the PR and add.omc/(or at least.omc/sessions/) to.gitignoreto prevent re-adding.