Using same serialization strategy for request object in cached views, this prevents some failing tests in environments

with different charsets
This commit is contained in:
Jose Lorenzo Rodriguez 2012-03-27 00:57:15 -04:30
parent 6b045318d8
commit 4f6f041730
2 changed files with 2 additions and 2 deletions

View file

@ -1423,7 +1423,7 @@ class DispatcherTest extends CakeTestCase {
$cached = preg_replace('/<!--+[^<>]+-->/', '', $cached);
$this->assertTextEquals($cached, $out);
$this->assertTextEquals($out, $cached);
$filename = $this->__cachePath($request->here());
unlink($filename);

View file

@ -291,7 +291,7 @@ class CacheHelper extends AppHelper {
}
$file .= '
$request = unserialize(\'' . str_replace("'", "\\'", serialize($this->request)) . '\');
$request = unserialize(base64_decode(\'' . base64_encode(serialize($this->request)) . '\'));
$response = new CakeResponse(array("charset" => Configure::read("App.encoding")));
$controller = new ' . $this->_View->name . 'Controller($request, $response);
$controller->plugin = $this->plugin = \'' . $this->_View->plugin . '\';