Skip to content

Commit

Permalink
QA: Fix bugs identified by check_all_pages.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
TheWitness committed Jan 16, 2025
1 parent 2503483 commit 33c8315
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 11 deletions.
2 changes: 1 addition & 1 deletion data_input.php
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@ function data_edit() {
} else {
$url = html_escape('data_input.php?action=field_remove_confirm&id=' . $field['id'] . '&data_input_id=' . get_request_var('id'));

form_selectable_cell("<a class='delete deleteMarker fa fa-times' href='$url' title='" . __esc('Delete') . "'></a>", $id, '', 'right');
form_selectable_cell("<a class='delete deleteMarker fa fa-times' href='$url' title='" . __esc('Delete') . "'></a>", $i, '', 'right');
}

form_end_row();
Expand Down
4 changes: 2 additions & 2 deletions graphs_new.php
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ function graphs() {
$host = db_fetch_row_prepared('SELECT id, description, hostname, host_template_id
FROM host
WHERE id = ?',
array(get_request_var('host_id')));
array(get_filter_request_var('host_id')));
}

if (cacti_sizeof($host)) {
Expand All @@ -479,7 +479,7 @@ function graphs() {
if (get_request_var('rows') == '-1') {
$rows = read_user_setting('num_rows_table', read_config_option('num_rows_table'), true);
} else {
$rows = get_request_var('rows');
$rows = get_filter_request_var('rows');
}

form_start('graphs_new.php', 'chk');
Expand Down
11 changes: 7 additions & 4 deletions host_templates.php
Original file line number Diff line number Diff line change
Expand Up @@ -558,23 +558,26 @@ function template_edit() {

$header_label = __esc('Device Templates [edit: %s]', $host_template['name']);
} else {
$host_template = array();

$header_label = __('Device Templates [new]');

set_request_var('id', 0);
}

if (!cacti_sizeof($host_template) || $host_template['version'] == '') {
if (!cacti_sizeof($host_template) || !isset($host_template['version']) || $host_template['version'] == '') {
$fields_host_template_edit['version']['default'] = CACTI_VERSION;
}

if (!cacti_sizeof($host_template) || $host_template['author'] == '') {
if (!cacti_sizeof($host_template) || !isset($host_template['author']) || $host_template['author'] == '') {
$fields_host_template_edit['author']['default'] = read_config_option('packaging_author');
}

if (!cacti_sizeof($host_template) || $host_template['email'] == '') {
if (!cacti_sizeof($host_template) || !isset($host_template['email']) || $host_template['email'] == '') {
$fields_host_template_edit['email']['default'] = read_config_option('packaging_email');
}

if (!cacti_sizeof($host_template) || $host_template['copyright'] == '') {
if (!cacti_sizeof($host_template) || !isset($host_template['copyright']) || $host_template['copyright'] == '') {
$fields_host_template_edit['copyright']['default'] = read_config_option('packaging_copyright');
}

Expand Down
6 changes: 3 additions & 3 deletions lib/auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -3143,12 +3143,12 @@ function auth_valid_user($user_id) {
function auth_row_cache_purge($user_id, $class = 'all') {
if ($user_id > 0) {
if ($class == 'all') {
db_execute_prepared('DELETE FROM
db_execute_prepared('DELETE
FROM user_auth_row_cache
WHERE user_id = ?',
array($user_id));
} else {
db_execute_prepared('DELETE FROM
db_execute_prepared('DELETE
FROM user_auth_row_cache
WHERE user_id = ?
AND class = ?',
Expand All @@ -3158,7 +3158,7 @@ function auth_row_cache_purge($user_id, $class = 'all') {
if ($class == 'all') {
db_execute('TRUNCATE user_auth_row_cache');
} else {
db_execute_prepared('DELETE FROM
db_execute_prepared('DELETE
FROM user_auth_row_cache
WHERE class = ?',
array($class));
Expand Down
2 changes: 1 addition & 1 deletion utilities.php
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +787,7 @@ function create_poller_cache_filter() {
'array' => $status,
'value' => '-1'
),
'poller_actions' => array(
'poller_action' => array(
'method' => 'drop_array',
'friendly_name' => __('Actions'),
'filter' => FILTER_VALIDATE_INT,
Expand Down

0 comments on commit 33c8315

Please sign in to comment.