From 6a8bf274e2add654ce3fd0df386f2af59ef917ca Mon Sep 17 00:00:00 2001 From: pies Date: Sun, 19 Jun 2005 03:55:52 +0000 Subject: [PATCH] - minor fix to CCSS git-svn-id: https://svn.cakephp.org/repo/trunk/cake@253 3807eeeb-6ff5-0310-8944-8be069107fe0 --- libs/basics.php | 11 +++++++++++ libs/log.php | 2 +- public/css.php | 6 +++--- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/libs/basics.php b/libs/basics.php index ff8527d9a..1a3fcc8a0 100644 --- a/libs/basics.php +++ b/libs/basics.php @@ -30,6 +30,17 @@ * */ +/** + * Basic defines + */ +define('SECOND', 1); +define('MINUTE', 60 * SECOND); +define('HOUR', 60 * MINUTE); +define('DAY', 24 * HOUR); +define('WEEK', 7 * DAY); +define('MONTH', 30 * DAY); +define('YEAR', 365 * DAY); + /** * Loads all models. * diff --git a/libs/log.php b/libs/log.php index d3415355c..15760fffd 100644 --- a/libs/log.php +++ b/libs/log.php @@ -45,7 +45,7 @@ class Log /** * Error constant. Used for differentiating error logging and debugging. - * + * Currently PHP supports LOG_DEBUG */ define ('LOG_ERROR', 2); diff --git a/public/css.php b/public/css.php index d11a1b737..14ca37d56 100644 --- a/public/css.php +++ b/public/css.php @@ -1,6 +1,7 @@ write($content); } - -if (!preg_match('|^ccss/([a-z0-9\/\-\\\]+\.[a-z0-9]+)$|i', $url, $regs)) +if (preg_match('|\.\.|', $url) || !preg_match('|^ccss/(.+)$|i', $url, $regs)) die('Wrong file name.'); $filename = 'css/'.$regs[1]; @@ -62,7 +62,7 @@ else header("Date: ".date("D, j M Y G:i:s ", $templateModified).'GMT'); header("Content-Type: text/css"); -header("Expires: ".date("D, j M Y G:i:s T", time()+24*60*60)); +header("Expires: ".date("D, j M Y G:i:s T", time()+DAY)); header("Cache-Control: cache"); // HTTP/1.1 header("Pragma: cache"); // HTTP/1.0 print $output;