Skip to content
Permalink
Browse files

Doing a little optimization for php 5.1 <, also fixing tests on Windo…

…ws. Fixes #155.
  • Loading branch information...
renan committed Oct 15, 2009
1 parent 082156f commit 43dbf716241bc16c227b8e85ddae3e65bdce4c3e
Showing with 7 additions and 7 deletions.
  1. +6 −6 cake/libs/session.php
  2. +1 −1 cake/tests/cases/libs/view/helpers/session.test.php
@@ -592,15 +592,15 @@ function _checkValid() {
function __regenerateId() {
$oldSessionId = session_id();
if ($oldSessionId) {
$sessionpath = session_save_path();
if (empty($sessionpath)) {
$sessionpath = "/tmp";
}
if (session_id() != "" || isset($_COOKIE[session_name()])) {
if (session_id() != ''|| isset($_COOKIE[session_name()])) {
setcookie(Configure::read('Session.cookie'), '', time() - 42000, $this->path);
}
session_regenerate_id(true);
if (PHP_VERSION < 5.1) {
$sessionPath = session_save_path();
if (empty($sessionPath)) {
$sessionPath = '/tmp';
}
$newSessid = session_id();
if (function_exists('session_write_close')) {
@@ -610,7 +610,7 @@ function __regenerateId() {
session_id($oldSessionId);
session_start();
session_destroy();
$file = $sessionpath . DS . "sess_$oldSessionId";
$file = $sessionPath . DS . 'sess_' . $oldSessionId;
@unlink($file);
$this->__initSession();
session_id($newSessid);
@@ -224,7 +224,7 @@ function testFlashMissingLayout() {
ob_clean();
$this->assertPattern("/Missing Layout/", $result);
$this->assertPattern("/layouts\/does_not_exist.ctp/", $result);
$this->assertPattern("/layouts(\\\|\/)does_not_exist.ctp/", $result);
}
/**
* testID method

0 comments on commit 43dbf71

Please sign in to comment.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.