Skip to content

Commit

Permalink
Resoving Isuse #2645
Browse files Browse the repository at this point in the history
The cacti setting 'base_url' may be incorrect for some systems. Correct it.
  • Loading branch information
cigamit committed Apr 26, 2019
1 parent b721177 commit 62019c6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Cacti CHANGELOG
-issue#2632: Automated Network Scans are Not Working
-issue#2635: Multiple Database Sync Issues in v1.2.x
-issue#2638: Support disabling PHP SNMP extension
-issue#2645: The cacti setting 'base_url' may be incorrect for some systems. Correct it.

1.2.3
-issue#1063: Tree View does not display the last item correctly under 'Modern' theme
Expand Down
12 changes: 11 additions & 1 deletion lib/reports.php
Original file line number Diff line number Diff line change
Expand Up @@ -853,7 +853,17 @@ function reports_graph_image($report, $item, $timespan, $output, $theme = 'class
}

if ($report['graph_linked'] == 'on' ) {
$out = "<a href='" . html_escape(read_config_option('base_url') . '/graph.php?action=view&local_graph_id='.$item['local_graph_id']."&rra_id=0") . "'>" . $out . '</a>';
if (substr(read_config_option('base_url'), 0, 4) != 'http') {
if (read_config_option('force_https') == 'on') {
$prefix = 'https://';
} else {
$prefix = 'http://';
}

set_config_option('base_url', $prefix . read_config_option('base_url'));
}

$out = "<a href='" . $prefix . html_escape(read_config_option('base_url', true) . '/graph.php?action=view&local_graph_id='.$item['local_graph_id']."&rra_id=0") . "'>" . $out . '</a>';
}

return $out . PHP_EOL;
Expand Down

0 comments on commit 62019c6

Please sign in to comment.