mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
- 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:
parent
a8eed860b2
commit
6a8bf274e2
3 changed files with 15 additions and 4 deletions
|
@ -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.
|
||||
*
|
||||
|
|
|
@ -45,7 +45,7 @@ class Log
|
|||
|
||||
/**
|
||||
* Error constant. Used for differentiating error logging and debugging.
|
||||
*
|
||||
* Currently PHP supports LOG_DEBUG
|
||||
*/
|
||||
define ('LOG_ERROR', 2);
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue