diff --git a/cake/libs/cake_response.php b/cake/libs/cake_response.php index 180aa2d9b..60259f3be 100644 --- a/cake/libs/cake_response.php +++ b/cake/libs/cake_response.php @@ -616,7 +616,7 @@ class CakeResponse { $this->header(array( 'Date' => gmdate("D, j M Y G:i:s ", $since) . 'GMT', 'Expires' => gmdate("D, j M Y H:i:s", $time) . " GMT", - 'Cache-Control' => 'public, max-age=' . $time - time(), + 'Cache-Control' => 'public, max-age=' . ($time - time()), 'Pragma' => 'cache' )); } diff --git a/cake/libs/view/media.php b/cake/libs/view/media.php index 43271fc93..ae9653bb9 100644 --- a/cake/libs/view/media.php +++ b/cake/libs/view/media.php @@ -21,8 +21,6 @@ App::import('View', 'View', false); class MediaView extends View { - - /** * Constructor * diff --git a/cake/tests/cases/libs/cake_response.test.php b/cake/tests/cases/libs/cake_response.test.php index 7e809cc80..d2e446507 100644 --- a/cake/tests/cases/libs/cake_response.test.php +++ b/cake/tests/cases/libs/cake_response.test.php @@ -229,9 +229,9 @@ class CakeResponseTestCase extends CakeTestCase { $since = time(); $time = '+1 day'; $expected = array( - 'Date' => date("D, j M Y G:i:s ", $since) . 'GMT', + 'Date' => gmdate("D, j M Y G:i:s ", $since) . 'GMT', 'Expires' => gmdate("D, j M Y H:i:s", strtotime($time)) . " GMT", - 'Cache-Control' => 'cache', + 'Cache-Control' => 'public, max-age=' . (strtotime($time) - time()), 'Pragma' => 'cache' ); $response->cache($since); @@ -241,9 +241,9 @@ class CakeResponseTestCase extends CakeTestCase { $since = time(); $time = '+5 day'; $expected = array( - 'Date' => date("D, j M Y G:i:s ", $since) . 'GMT', + 'Date' => gmdate("D, j M Y G:i:s ", $since) . 'GMT', 'Expires' => gmdate("D, j M Y H:i:s", strtotime($time)) . " GMT", - 'Cache-Control' => 'cache', + 'Cache-Control' => 'public, max-age=' . (strtotime($time) - time()), 'Pragma' => 'cache' ); $response->cache($since, $time); @@ -253,9 +253,9 @@ class CakeResponseTestCase extends CakeTestCase { $since = time(); $time = time(); $expected = array( - 'Date' => date("D, j M Y G:i:s ", $since) . 'GMT', + 'Date' => gmdate("D, j M Y G:i:s ", $since) . 'GMT', 'Expires' => gmdate("D, j M Y H:i:s", $time) . " GMT", - 'Cache-Control' => 'cache', + 'Cache-Control' => 'public, max-age=0', 'Pragma' => 'cache' ); $response->cache($since, $time);