From 98b1d8335ff2bdfe97e2a47b0608d4524c1fe287 Mon Sep 17 00:00:00 2001 From: Hugues Hiegel Date: Fri, 22 Apr 2011 16:58:41 +0200 Subject: [PHP] define errors --- BigLine.php | 9 +++++---- Config.BigLine.php | 12 ++++++------ 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/BigLine.php b/BigLine.php index ac8c40f..2f689d5 100644 --- a/BigLine.php +++ b/BigLine.php @@ -107,7 +107,7 @@ else $TracksPerDay = floor($playcount / $days); $TracksPerWeek = floor($playcount / $weeks); $TracksPerMonth = floor($playcount / $months); - define(TRACKS_PER_ALBUM, 13); + define("TRACKS_PER_ALBUM", 13); $AlbumsPerDay = floor($TracksPerDay / TRACKS_PER_ALBUM); $AlbumsPerWeek = floor($TracksPerWeek / TRACKS_PER_ALBUM); $AlbumsPerMonth = floor($TracksPerMonth / TRACKS_PER_ALBUM); @@ -163,7 +163,7 @@ else break; } - define(ANGLE,2); + define("ANGLE",2); $y=0; $username=ucfirst($username); @@ -240,14 +240,15 @@ function GetGMT($time) function SendCacheHeaders($lastmodified, $maxage, $limit="public") { $LastModified = GetGMT($lastmodified); - if ("$_SERVER[HTTP_IF_MODIFIED_SINCE]" == "$LastModified") + if (array_key_exists("HTTP_IF_MODIFIED_SINCE", $_SERVER) && + $_SERVER['HTTP_IF_MODIFIED_SINCE'] == "$LastModified") { header("HTTP/1.1 304 Not Modified"); exit; } /* Give a fresh copy */ - $Expires = GetGMT($_SERVER[REQUEST_TIME] + $maxage); + $Expires = GetGMT($_SERVER['REQUEST_TIME'] + $maxage); header("Cache-Control: max-age=$maxage, $limit"); header("Last-Modified: $LastModified"); header("Expires: $Expires"); diff --git a/Config.BigLine.php b/Config.BigLine.php index 047da12..5d40922 100644 --- a/Config.BigLine.php +++ b/Config.BigLine.php @@ -1,13 +1,13 @@