Adding fix for Ticket #1661

Fixed same issue in function cache() in basics.php

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4014 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
phpnut 2006-11-28 22:34:28 +00:00
parent 257ff1ef89
commit 5a74812c7b
2 changed files with 6 additions and 5 deletions

View file

@ -921,9 +921,10 @@
if (defined('DISABLE_CACHE')) {
return null;
}
$now = time();
if (!is_numeric($expires)) {
$expires = strtotime($expires);
$expires = strtotime($expires, $now);
}
switch(strtolower($target)) {
@ -934,9 +935,9 @@
$filename = WWW_ROOT . $path;
break;
}
$now = time();
$timediff=$expires - $now;
$filetime=@filemtime($filename);
$timediff = $expires - $now;
$filetime = @filemtime($filename);
if ($data == null) {
// Read data from file

View file

@ -195,7 +195,7 @@ class CacheHelper extends AppHelper {
if (is_numeric($timestamp)) {
$cacheTime = $now + $timestamp;
} else {
$cacheTime = $now + strtotime($timestamp);
$cacheTime = strtotime($timestamp, $now);
}
$cache = convertSlash($this->here) . '.php';