mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-27 19:23:24 +02:00
rrdimage: Improve CGI & cosmetic changes
Write graph error messages to the system log, to simplify further inspection by the user. Add additional parameter check to prevent a possible redirect loop if the URL format is changed in the future. Cosmetic: Use underlining instead of background color for highlighting Fixes #10643 Signed-off-by: Leo-Andres Hofmann <hofmann@leo-andres.de> Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
This commit is contained in:
committed by
Michael Tremer
parent
ad3cc7c98d
commit
c095f81435
@@ -60,7 +60,7 @@ unless(($origin =~ /^\w+?\.cgi$/) && ($graph =~ /^[\w-]+?$/) && ($range ~~ @Grap
|
||||
|
||||
# Unsupported graph origin: Redirect request to the CGI specified in the "origin" parameter
|
||||
# This enables backwards compatibility with addons that use Graphs::makegraphbox to ouput their own graphs
|
||||
unless($origin ~~ @supported_origins) {
|
||||
unless(($origin ~~ @supported_origins) || ($origin eq "getrrdimage.cgi")) {
|
||||
# Rewrite to old URL format: /[graph origin cgi]?[graph name]?[time range]
|
||||
my $location = "https://$ENV{'SERVER_NAME'}:$ENV{'SERVER_PORT'}/cgi-bin/${origin}?${graph}?${range}";
|
||||
|
||||
@@ -195,6 +195,10 @@ if($origin eq "entropy.cgi") { ## entropy.cgi
|
||||
# Add request parameters for debugging
|
||||
if($graphstatus) {
|
||||
$graphstatus = "$graphstatus\n($origin, $graph, $range)";
|
||||
|
||||
# Save message in system log for further inspection
|
||||
General::log($graphstatus);
|
||||
|
||||
_print_error($graphstatus);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user