Fix graph output base64 (#14701)

Mostly for people using unauth graphs instead of the api.
This commit is contained in:
Tony Murray
2022-12-15 15:58:56 -06:00
committed by GitHub
parent 1d3440b943
commit 88c86f2a19
2 changed files with 3 additions and 5 deletions

View File

@@ -89,7 +89,7 @@ try {
echo '<img src="data:' . ImageFormat::forGraph()->contentType() . ';base64,' . base64_encode($image_data) . '" alt="graph" />';
} else {
header('Content-type: ' . ImageFormat::forGraph()->contentType());
echo $output === 'base64' ? base64_encode($image_data) : $image_data;
echo (isset($vars['output']) && $vars['output'] === 'base64') ? base64_encode($image_data) : $image_data;
}
} catch (\LibreNMS\Exceptions\RrdGraphException $e) {
if (\LibreNMS\Util\Debug::isEnabled()) {