aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/rrd.php
diff options
context:
space:
mode:
authorPim van den Berg2013-09-14 12:42:14 +0200
committerPim van den Berg2013-09-14 12:42:14 +0200
commite7dcbd911ee813e33e0f307cb430ba102b1c7144 (patch)
tree02f05948c7f168640880ee891dfa9d1e0eb15a14 /rrd.php
parentsolve undefined index cat in index.php (diff)
downloadapt-panopticon_cgp-e7dcbd911ee813e33e0f307cb430ba102b1c7144.zip
apt-panopticon_cgp-e7dcbd911ee813e33e0f307cb430ba102b1c7144.tar.gz
apt-panopticon_cgp-e7dcbd911ee813e33e0f307cb430ba102b1c7144.tar.bz2
apt-panopticon_cgp-e7dcbd911ee813e33e0f307cb430ba102b1c7144.tar.xz
rrd.php: ob_clean if ob_get_length to prevent from a php notice
Reported-by: tbleiker (https://github.com/pommi/CGP/issues/26)
Diffstat (limited to 'rrd.php')
-rw-r--r--rrd.php6
1 files changed, 3 insertions, 3 deletions
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'])) {
8 header('Content-Type: application/octet-stream'); 8 header('Content-Type: application/octet-stream');
9 header('Content-Disposition: attachment; filename='.basename($file)); 9 header('Content-Disposition: attachment; filename='.basename($file));
10 header("Expires: " .date(DATE_RFC822,strtotime($CONFIG['cache']." seconds"))); 10 header("Expires: " .date(DATE_RFC822,strtotime($CONFIG['cache']." seconds")));
11 ob_clean(); 11 if(ob_get_length()) ob_clean();
12 flush(); 12 flush();
13 readfile($file); 13 readfile($file);
14} else { 14} else {
15 header('HTTP/1.0 403 Forbidden'); 15 header('HTTP/1.0 403 Forbidden');
16 16