mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Doing a little optimization for php 5.1 <, also fixing tests on Windows. Fixes #155.
This commit is contained in:
parent
082156f9a1
commit
43dbf71624
2 changed files with 7 additions and 7 deletions
|
@ -592,15 +592,15 @@ class CakeSession extends Object {
|
|||
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 @@ class CakeSession extends Object {
|
|||
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 @@ class SessionHelperTest extends CakeTestCase {
|
|||
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
|
||||
|
|
Loading…
Reference in a new issue