Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: 2
updates:
- package-ecosystem: "composer"
directory: "/"
schedule:
interval: "weekly"
open-pull-requests-limit: 10
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
open-pull-requests-limit: 10
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@
.git*
config.php
locales/po/*.mo
.omc/
2 changes: 1 addition & 1 deletion Net/DNS2/Cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public function get($key)
if ($this->cache_serializer == 'json') {
return json_decode($this->cache_data[$key]['object']);
} else {
return unserialize($this->cache_data[$key]['object']);
return unserialize($this->cache_data[$key]['object'], array('allowed_classes' => false));
}
Comment on lines 79 to 83
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

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

unserialize(..., ['allowed_classes' => false]) will prevent cached DNS response objects from being rehydrated as their original Net_DNS2_* classes when cache_serializer is serialize (it will return __PHP_Incomplete_Class trees). That breaks the documented behavior that serialize mode preserves class info and can break consumers relying on instanceof or methods. Consider either (a) switching cache serialization to a safe non-object format (e.g., JSON) when caching is enabled, or (b) using an explicit allowlist of the specific Net_DNS2_* classes that can appear in cached responses instead of false.

Copilot uses AI. Check for mistakes.
} else {

Expand Down
4 changes: 2 additions & 2 deletions Net/DNS2/Cache/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public function open($cache_file, $size, $serializer)
$decoded = json_decode($data, true);
} else {

$decoded = unserialize($data);
$decoded = unserialize($data, array('allowed_classes' => false));
}

if (is_array($decoded) == true) {
Expand Down Expand Up @@ -170,7 +170,7 @@ public function __destruct()
$decoded = json_decode($data, true);
} else {

$decoded = unserialize($data);
$decoded = unserialize($data, array('allowed_classes' => false));
}

if (is_array($decoded) == true) {
Expand Down
4 changes: 2 additions & 2 deletions Net/DNS2/Cache/Shm.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public function open($cache_file, $size, $serializer)
$decoded = json_decode($data, true);
} else {

$decoded = unserialize($data);
$decoded = unserialize($data, array('allowed_classes' => false));
}

if (is_array($decoded) == true) {
Expand Down Expand Up @@ -213,7 +213,7 @@ public function __destruct()
$decoded = json_decode($data, true);
} else {

$decoded = unserialize($data);
$decoded = unserialize($data, array('allowed_classes' => false));
}

if (is_array($decoded) == true) {
Expand Down
40 changes: 20 additions & 20 deletions database.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ function flowview_db_close(&$flowview_cnn) {
* @return '1' for success, '0' for error
*/
function flowview_db_execute($sql, $log = true, $cnn_id = false) {
$flowview_cnn = flowview_get_connection($cnn_id);;
$flowview_cnn = flowview_get_connection($cnn_id);

return db_execute($sql, $log, $flowview_cnn);
}
Expand All @@ -80,7 +80,7 @@ function flowview_db_execute($sql, $log = true, $cnn_id = false) {
* @return '1' for success, '0' for error
*/
function flowview_db_execute_prepared($sql, $parms = array(), $log = true, $cnn_id = false) {
$flowview_cnn = flowview_get_connection($cnn_id);;
$flowview_cnn = flowview_get_connection($cnn_id);

return db_execute_prepared($sql, $parms, $log, $flowview_cnn);
}
Expand All @@ -97,7 +97,7 @@ function flowview_db_execute_prepared($sql, $parms = array(), $log = true, $cnn_
* @return (bool) the output of the sql query as a single variable
*/
function flowview_db_fetch_cell($sql, $col_name = '', $log = true, $cnn_id = false) {
$flowview_cnn = flowview_get_connection($cnn_id);;
$flowview_cnn = flowview_get_connection($cnn_id);

return db_fetch_cell($sql, $col_name, $log, $flowview_cnn);
}
Expand All @@ -115,7 +115,7 @@ function flowview_db_fetch_cell($sql, $col_name = '', $log = true, $cnn_id = fal
* @return (bool) the output of the sql query as a single variable
*/
function flowview_db_fetch_cell_prepared($sql, $params = array(), $col_name = '', $log = true, $cnn_id = false) {
$flowview_cnn = flowview_get_connection($cnn_id);;
$flowview_cnn = flowview_get_connection($cnn_id);

return db_fetch_cell_prepared($sql, $params, $col_name, $log, $flowview_cnn);
}
Expand All @@ -130,7 +130,7 @@ function flowview_db_fetch_cell_prepared($sql, $params = array(), $col_name = ''
* @return the first row of the result as a hash
*/
function flowview_db_fetch_row($sql, $log = true, $cnn_id = false) {
$flowview_cnn = flowview_get_connection($cnn_id);;
$flowview_cnn = flowview_get_connection($cnn_id);

return db_fetch_row($sql, $log, $flowview_cnn);
}
Expand All @@ -146,7 +146,7 @@ function flowview_db_fetch_row($sql, $log = true, $cnn_id = false) {
* @return the first row of the result as a hash
*/
function flowview_db_fetch_row_prepared($sql, $params = array(), $log = true, $cnn_id = false) {
$flowview_cnn = flowview_get_connection($cnn_id);;
$flowview_cnn = flowview_get_connection($cnn_id);

return db_fetch_row_prepared($sql, $params, $log, $flowview_cnn);
}
Expand All @@ -161,7 +161,7 @@ function flowview_db_fetch_row_prepared($sql, $params = array(), $log = true, $c
* @return the entire result set as a multi-dimensional hash
*/
function flowview_db_fetch_assoc($sql, $log = true, $cnn_id = false) {
$flowview_cnn = flowview_get_connection($cnn_id);;
$flowview_cnn = flowview_get_connection($cnn_id);

return db_fetch_assoc($sql, $log, $flowview_cnn);
}
Expand All @@ -177,7 +177,7 @@ function flowview_db_fetch_assoc($sql, $log = true, $cnn_id = false) {
* @return the entire result set as a multi-dimensional hash
*/
function flowview_db_fetch_assoc_prepared($sql, $params = array(), $log = true, $cnn_id = false) {
$flowview_cnn = flowview_get_connection($cnn_id);;
$flowview_cnn = flowview_get_connection($cnn_id);

return db_fetch_assoc_prepared($sql, $params, $log, $flowview_cnn);
}
Expand All @@ -190,7 +190,7 @@ function flowview_db_fetch_assoc_prepared($sql, $params = array(), $log = true,
* @return the id of the last auto incriment row that was created
*/
function flowview_db_fetch_insert_id($cnn_id = false) {
$flowview_cnn = flowview_get_connection($cnn_id);;
$flowview_cnn = flowview_get_connection($cnn_id);

return db_fetch_insert_id($flowview_cnn);
}
Expand All @@ -206,7 +206,7 @@ function flowview_db_fetch_insert_id($cnn_id = false) {
* @return the auto incriment id column (if applicable)
*/
function flowview_db_replace($table_name, $array_items, $keyCols, $cnn_id = false) {
$flowview_cnn = flowview_get_connection($cnn_id);;
$flowview_cnn = flowview_get_connection($cnn_id);

return db_replace($table_name, $array_items, $keyCols, $flowview_cnn);
}
Expand All @@ -223,7 +223,7 @@ function flowview_db_replace($table_name, $array_items, $keyCols, $cnn_id = fals
* @return the auto incriment id column (if applicable)
*/
function flowview_sql_save($array_items, $table_name, $key_cols = 'id', $autoinc = true, $cnn_id = false) {
$flowview_cnn = flowview_get_connection($cnn_id);;
$flowview_cnn = flowview_get_connection($cnn_id);

return sql_save($array_items, $table_name, $key_cols, $autoinc, $flowview_cnn);
}
Expand All @@ -238,7 +238,7 @@ function flowview_sql_save($array_items, $table_name, $key_cols = 'id', $autoinc
* @return (bool) the output of the sql query as a single variable
*/
function flowview_db_table_exists($table, $log = true, $cnn_id = false) {
$flowview_cnn = flowview_get_connection($cnn_id);;
$flowview_cnn = flowview_get_connection($cnn_id);

preg_match("/([`]{0,1}(?<database>[\w_]+)[`]{0,1}\.){0,1}[`]{0,1}(?<table>[\w_]+)[`]{0,1}/", $table, $matches);
if ($matches !== false && array_key_exists('table', $matches)) {
Expand All @@ -250,7 +250,7 @@ function flowview_db_table_exists($table, $log = true, $cnn_id = false) {
}

function flowview_db_table_create($table, $data, $cnn_id = false) {
$flowview_cnn = flowview_get_connection($cnn_id);;
$flowview_cnn = flowview_get_connection($cnn_id);

$result = flowview_db_fetch_assoc('SHOW TABLES');
$tables = array();
Expand Down Expand Up @@ -352,13 +352,13 @@ function flowview_db_table_create($table, $data, $cnn_id = false) {
}

function flowview_db_column_exists($table, $column, $log = true, $cnn_id = false) {
$flowview_cnn = flowview_get_connection($cnn_id);;
$flowview_cnn = flowview_get_connection($cnn_id);

return db_column_exists($table, $column, $log, $flowview_cnn);
}

function flowview_db_add_column($table, $column, $log = true, $cnn_id = false) {
$flowview_cnn = flowview_get_connection($cnn_id);;
$flowview_cnn = flowview_get_connection($cnn_id);

return db_add_column($table, $column, $log, $flowview_cnn);
}
Expand All @@ -372,9 +372,9 @@ function flowview_db_add_column($table, $column, $log = true, $cnn_id = false) {
* or false on error
*/
function flowview_db_affected_rows($cnn_id = false) {
$flowview_cnn = flowview_get_connection($cnn_id);;
$flowview_cnn = flowview_get_connection($cnn_id);

return db_affected_rows($flowview_cnn);;
return db_affected_rows($flowview_cnn);
}

/**
Expand All @@ -388,7 +388,7 @@ function flowview_db_affected_rows($cnn_id = false) {
* @return bool The output of the sql query as a single variable
*/
function flowview_db_index_exists($table, $index, $log = true, $cnn_id = false) {
$flowview_cnn = flowview_get_connection($cnn_id);;
$flowview_cnn = flowview_get_connection($cnn_id);

return db_index_exists($table, $index, $log, $flowview_cnn);
}
Expand All @@ -412,13 +412,13 @@ function flowview_get_connection($cnn_id) {
* @return (array) An array of column types indexed by the column names
*/
function flowview_db_get_table_column_types($table, $cnn_id = false) {
$flowview_cnn = flowview_get_connection($cnn_id);;
$flowview_cnn = flowview_get_connection($cnn_id);

$columns = db_fetch_assoc("SHOW COLUMNS FROM $table", false, $flowview_cnn);
$cols = array();
if (cacti_sizeof($columns)) {
foreach($columns as $col) {
$cols[$col['Field']] = array('type' => $col['Type'], 'null' => $col['Null'], 'default' => $col['Default'], 'extra' => $col['Extra']);;
$cols[$col['Field']] = array('type' => $col['Type'], 'null' => $col['Null'], 'default' => $col['Default'], 'extra' => $col['Extra']);
}
}

Expand Down
24 changes: 12 additions & 12 deletions flowview_databases.php
Original file line number Diff line number Diff line change
Expand Up @@ -1035,19 +1035,19 @@ function() {
}

$(function() {
$('#refresh').click(function() {
$('#refresh').on('click', function() {
applyFilter();
});

$('#clear').click(function() {
$('#clear').on('click', function() {
clearFilter();
});

$('#purge').click(function() {
$('#purge').on('click', function() {
purgeFilter();
});

$('#form').submit(function(event) {
$('#form').on('submit', function(event) {
event.preventDefault();
applyFilter();
});
Expand Down Expand Up @@ -1353,19 +1353,19 @@ function purgeFilter() {
}

$(function() {
$('#refresh').click(function() {
$('#refresh').on('click', function() {
applyFilter();
});

$('#clear').click(function() {
$('#clear').on('click', function() {
clearFilter();
});

$('#purge').click(function() {
$('#purge').on('click', function() {
purgeFilter();
});

$('#form').submit(function(event) {
$('#form').on('submit', function(event) {
event.preventDefault();
applyFilter();
});
Expand Down Expand Up @@ -1701,19 +1701,19 @@ function() {
}

$(function() {
$('#refresh').click(function() {
$('#refresh').on('click', function() {
applyFilter();
});

$('#clear').click(function() {
$('#clear').on('click', function() {
clearFilter();
});

$('#purge').click(function() {
$('#purge').on('click', function() {
purgeFilter();
});

$('#form').submit(function(event) {
$('#form').on('submit', function(event) {
event.preventDefault();
applyFilter();
});
Expand Down
14 changes: 7 additions & 7 deletions flowview_devices.php
Original file line number Diff line number Diff line change
Expand Up @@ -568,14 +568,14 @@ function edit_device() {
</form>
<script type='text/javascript'>
function applyFilter() {
strURL = 'flowview_devices.php?action=edit&id=<?php print get_request_var('id');?>&tab=templates&header=false';
strURL = 'flowview_devices.php?action=edit&id=<?php print (int)get_filter_request_var('id'); ?>&tab=templates&header=false';
strURL += '&template=' + $('#template').val();
strURL += '&ex_addr=' + $('#ex_addr').val();
loadPageNoHeader(strURL);
}

function exportFilter() {
strURL = 'flowview_devices.php?action=export&id=<?php print get_request_var('id');?>&tab=templates&header=false';
strURL = 'flowview_devices.php?action=export&id=<?php print (int)get_filter_request_var('id'); ?>&tab=templates&header=false';
strURL += '&template=' + $('#template').val();
strURL += '&ex_addr=' + $('#ex_addr').val();

Expand All @@ -585,15 +585,15 @@ function exportFilter() {
}

$(function() {
$('#template, #ex_addr').change(function() {
$('#template, #ex_addr').on('change', function() {
applyFilter();
});

$('#go').click(function() {
$('#go').on('click', function() {
applyFilter();
});

$('#export').click(function() {
$('#export').on('click', function() {
exportFilter();
});

Expand Down Expand Up @@ -796,11 +796,11 @@ function clearFilter() {
}

$(function() {
$('#clear').click(function() {
$('#clear').on('click', function() {
clearFilter();
});

$('#listeners').submit(function(event) {
$('#listeners').on('submit', function(event) {
event.preventDefault();
applyFilter();
});
Expand Down
6 changes: 3 additions & 3 deletions flowview_filters.php
Original file line number Diff line number Diff line change
Expand Up @@ -273,15 +273,15 @@ function clearFilter() {
}

$(function() {
$('#clear').click(function() {
$('#clear').on('click', function() {
clearFilter();
});

$('#rows').change(function() {
$('#rows').on('change', function() {
applyFilter();
});

$('#form_filter').submit(function(event) {
$('#form_filter').on('submit', function(event) {
event.preventDefault();
applyFilter();
});
Expand Down
Loading