Skip to content
Permalink
Browse files

Removing addslashes/stripslashes in cache file generation as they wer…

…e creating corrupted serialized objects. Replacing with a simple str_replace() on ' instead.
  • Loading branch information...
markstory committed May 2, 2010
1 parent 13cc8e7 commit 12cbf3198a708cdaa38dfba2e91b40a6ae674fab
Showing with 5 additions and 2 deletions.
  1. +2 −2 cake/libs/view/helpers/cache.php
  2. +3 −0 cake/tests/cases/dispatcher.test.php
@@ -230,9 +230,9 @@ function __writeFile($content, $timestamp, $useCallbacks = false) {
$controller->layout = $this->layout = \'' . $this->layout. '\';
$controller->webroot = $this->webroot = \'' . $this->webroot . '\';
$controller->here = $this->here = \'' . $this->here . '\';
$controller->params = $this->params = unserialize(stripslashes(\'' . addslashes(serialize($this->params)) . '\'));
$controller->params = $this->params = unserialize(\'' . str_replace("'", "\\'", serialize($this->params)) . '\');
$controller->action = $this->action = unserialize(\'' . serialize($this->action) . '\');
$controller->data = $this->data = unserialize(stripslashes(\'' . addslashes(serialize($this->data)) . '\'));
$controller->data = $this->data = unserialize(\'' . str_replace("'", "\\'", serialize($this->data)) . '\');
$controller->theme = $this->theme = \'' . $this->theme . '\';
Router::setRequestInfo(array($this->params, array(\'base\' => $this->base, \'webroot\' => $this->webroot)));';
@@ -1434,6 +1434,9 @@ public function testFullPageCachingDispatch() {
unlink($filename);
$url = 'test_cached_pages/index';
$_POST = array(
'slasher' => "Up in your's grill \ '"
);
ob_start();
$dispatcher->dispatch($url);

0 comments on commit 12cbf31

Please sign in to comment.
You can’t perform that action at this time.