diff --git a/cake/libs/view/helpers/cache.php b/cake/libs/view/helpers/cache.php index 52ebd75b9..e2e911b8c 100644 --- a/cake/libs/view/helpers/cache.php +++ b/cake/libs/view/helpers/cache.php @@ -225,15 +225,15 @@ class CacheHelper extends AppHelper { $file .= '$controller =& new ' . $this->controllerName . 'Controller(); $controller->plugin = $this->plugin = \''.$this->plugin.'\'; - $controller->helpers = $this->helpers = unserialize(\'' . serialize($this->helpers) . '\'); + $controller->helpers = $this->helpers = ' . var_export($this->helpers, true) . '; $controller->base = $this->base = \'' . $this->base . '\'; $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->action = $this->action = unserialize(\'' . serialize($this->action) . '\'); - $controller->data = $this->data = unserialize(stripslashes(\'' . addslashes(serialize($this->data)) . '\')); - $controller->viewVars = $this->viewVars = unserialize(stripslashes(\'' . addslashes(serialize($this->viewVars)) . '\')); + $controller->params = $this->params = ' . var_export($this->params, true) . '; + $controller->action = $this->action = ' . var_export($this->action, true) . '; + $controller->data = $this->data = ' . var_export($this->data, true) . '; + $controller->viewVars = $this->viewVars = ' . var_export($this->viewVars, true) . '; $controller->theme = $this->theme = \'' . $this->theme . '\'; Router::setRequestInfo(array($this->params, array(\'base\' => $this->base, \'webroot\' => $this->webroot)));'; diff --git a/cake/tests/cases/libs/view/helpers/cache.test.php b/cake/tests/cases/libs/view/helpers/cache.test.php index d2d6b43ee..45edea332 100644 --- a/cake/tests/cases/libs/view/helpers/cache.test.php +++ b/cake/tests/cases/libs/view/helpers/cache.test.php @@ -336,7 +336,7 @@ class CacheHelperTest extends CakeTestCase { $this->assertTrue(file_exists($filename)); $contents = file_get_contents($filename); - $this->assertPattern('/\$this\-\>viewVars.*variable/', $contents); + $this->assertPattern('/\$this\-\>viewVars/', $contents); $this->assertPattern('/extract\(\$this\-\>viewVars, EXTR_SKIP\);/', $contents); $this->assertPattern('/php echo \$variable/', $contents); $this->assertPattern('/variableValue/', $contents);