Skip to content

Various errors can occur due to undefined or incorrect variable names #2742

@ddb4github

Description

@ddb4github
diff -ruEbwB -x .git cacti/install/functions.php cacti/install/functions.php
--- cacti/install/functions.php	2019-06-14 17:18:23.000000000 +0800
+++ cacti/install/functions.php	2019-06-14 16:55:25.000000000 +0800
@@ -66,7 +66,7 @@
 }

 function install_test_local_database_connection() {
-	global $database_type, $database_hostname, $database_username, $database_password, $database_default, $database_type, $database_port, $database_ssl, $database_ssl_key, $database_ssl_cert, $database_ssl_ca;
+	global $database_type, $database_hostname, $database_username, $database_password, $database_default, $database_type, $database_port, $database_retries, $database_ssl, $database_ssl_key, $database_ssl_cert, $database_ssl_ca;

 	if (!isset($database_ssl)) $rdatabase_ssl = false;
 	if (!isset($database_ssl_key)) $rdatabase_ssl_key = false;
@@ -84,7 +84,7 @@
 }

 function install_test_remote_database_connection() {
-	global $rdatabase_type, $rdatabase_hostname, $rdatabase_username, $rdatabase_password, $rdatabase_default, $rdatabase_type, $rdatabase_port, $rdatabase_ssl, $rdatabase_ssl_key, $rdatabase_ssl_cert, $rdatabase_ssl_ca;
+	global $rdatabase_type, $rdatabase_hostname, $rdatabase_username, $rdatabase_password, $rdatabase_default, $rdatabase_type, $rdatabase_port, $rdatabase_retries, $rdatabase_ssl, $rdatabase_ssl_key, $rdatabase_ssl_cert, $rdatabase_ssl_ca;

 	if (!isset($rdatabase_ssl)) $rdatabase_ssl = false;
 	if (!isset($rdatabase_ssl_key)) $rdatabase_ssl_key = false;
diff -ruEbwB -x .git cacti/lib/api_aggregate.php cacti/lib/api_aggregate.php
--- cacti/lib/api_device.php	2019-06-14 17:18:23.000000000 +0800
+++ cacti/lib/api_device.php	2019-06-14 16:55:25.000000000 +0800
@@ -73,7 +73,7 @@
 	);

 	if (sizeof($graphs)) {
-		api_delete_graphs($graphs);
+		api_delete_graphs($graphs, 2);
 	}

 	clear_cached_allowed_types();
diff -ruEbwB -x .git cacti/lib/api_tree.php cacti/lib/api_tree.php
--- cacti/lib/api_tree.php	2019-06-14 17:18:23.000000000 +0800
+++ cacti/lib/api_tree.php	2019-06-14 16:55:25.000000000 +0800
@@ -265,7 +265,7 @@
  * @arg $parent - The parent leaf_id to search
  * @arg $sist_id - The host_id to search for
  * @returns - the id of the leaf if it exists */
-function api_tree_site_exists($tree_id, $parent, $host_id) {
+function api_tree_site_exists($tree_id, $parent, $site_id) {
 	$id = db_fetch_cell_prepared('SELECT id
 		FROM graph_tree_items
 		WHERE graph_tree_id = ?
diff -ruEbwB -x .git cacti/lib/clog_webapi.php cacti/lib/clog_webapi.php
--- cacti/lib/clog_webapi.php	2019-06-14 17:18:23.000000000 +0800
+++ cacti/lib/clog_webapi.php	2019-06-14 17:54:36.000000000 +0800
@@ -377,6 +377,8 @@
 }

 function clog_get_logfiles() {
+	global $config;
+
 	$stdFileArray = $stdLogFileArray = $stdErrFileArray = array();
 	$configLogPath = read_config_option('path_cactilog');
 	$configLogBase = basename($configLogPath);
diff -ruEbwB -x .git cacti/lib/functions.php cacti/lib/functions.php
--- cacti/lib/functions.php	2019-06-14 17:18:23.000000000 +0800
+++ cacti/lib/functions.php	2019-06-14 16:55:25.000000000 +0800
@@ -331,6 +331,8 @@
    @arg $value       - the values to be saved
    @returns          - void */
 function set_config_option($config_name, $value) {
+	global $config;
+
 	db_execute_prepared('REPLACE INTO settings
 		SET name = ?, value = ?',
 		array($config_name, $value));
diff -ruEbwB -x .git cacti/lib/html_filter.php cacti/lib/html_filter.php
--- cacti/lib/html_filter.php	2019-06-14 17:18:23.000000000 +0800
+++ cacti/lib/html_filter.php	2019-06-14 16:55:25.000000000 +0800
@@ -111,7 +111,7 @@
 	public function get_filter_row($index) {
 		if ($index === false ) {
 			return false;
-		} elseif (array_key_exists($this->filter_array['rows'][$index])) {
+		} elseif (array_key_exists($index, $this->filter_array['rows'])) {
 			return $this->filter_array['rows'][$index];
 		} else {
 			return false;
diff -ruEbwB -x .git cacti/user_admin.php cacti/user_admin.php
--- cacti/user_admin.php	2019-06-14 17:18:23.000000000 +0800
+++ cacti/user_admin.php	2019-06-14 16:55:25.000000000 +0800
@@ -2162,7 +2162,7 @@
 		break;
 	default:
 		if (api_plugin_hook_function('user_admin_run_action', get_request_var('tab'))) {
-			user_realms_edit();
+			user_realms_edit($header_label);
 		}
 		break;
 	}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugUndesired behaviourresolvedA fixed issue

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions