- minor fix to CCSS

git-svn-id: https://svn.cakephp.org/repo/trunk/cake@253 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
pies 2005-06-19 03:55:52 +00:00
parent a8eed860b2
commit 6a8bf274e2
3 changed files with 15 additions and 4 deletions

View file

@ -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.
*

View file

@ -45,7 +45,7 @@ class Log
/**
* Error constant. Used for differentiating error logging and debugging.
*
* Currently PHP supports LOG_DEBUG
*/
define ('LOG_ERROR', 2);

View file

@ -1,6 +1,7 @@
<?PHP
require(ROOT.'config'.DS.'paths.php');
require(LIBS.'basics.php');
require(LIBS.'file.php');
require(LIBS.'legacy.php');
@ -27,8 +28,7 @@ function write_css_cache ($path, $content)
return $cache->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;