From e7dcbd911ee813e33e0f307cb430ba102b1c7144 Mon Sep 17 00:00:00 2001 From: Pim van den Berg Date: Sat, 14 Sep 2013 12:42:14 +0200 Subject: rrd.php: ob_clean if ob_get_length to prevent from a php notice Reported-by: tbleiker (https://github.com/pommi/CGP/issues/26) --- rrd.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'rrd.php') diff --git a/rrd.php b/rrd.php index a873bf7..1b5997b 100644 --- a/rrd.php +++ b/rrd.php @@ -8,9 +8,9 @@ if ($file = validateRRDPath($CONFIG['datadir'], $_SERVER['PATH_INFO'])) { header('Content-Type: application/octet-stream'); header('Content-Disposition: attachment; filename='.basename($file)); header("Expires: " .date(DATE_RFC822,strtotime($CONFIG['cache']." seconds"))); - ob_clean(); - flush(); - readfile($file); + if(ob_get_length()) ob_clean(); + flush(); + readfile($file); } else { header('HTTP/1.0 403 Forbidden'); -- cgit v1.1