Skip to content

Commit

Permalink
Merge pull request #162 from Self-Perfection/patch-1
Browse files Browse the repository at this point in the history
Provide meaningful filenames for graphs
  • Loading branch information
pommi authored Jun 20, 2018
2 parents 5fe40a8 + e9a1fed commit 1920ca2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions type/Base.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -245,10 +245,13 @@ function rrd_graph($debug = false) {
if (is_numeric($this->cache) && $this->cache > 0)
header("Expires: " . date(DATE_RFC822,strtotime($this->cache." seconds")));

if ($style === 'svg')
if ($style === 'svg') {
header("content-type: image/svg+xml");
else
header('Content-Disposition: filename="' . $this->rrd_title . '.svg"');
} else {
header("content-type: image/png");
header('Content-Disposition: filename="' . $this->rrd_title . '.png"');
}

$shellcmd = array_merge(
$this->rrd_graph_command($style),
Expand Down

0 comments on commit 1920ca2

Please sign in to comment.