Skip to content

Commit

Permalink
Only variables should be passed by reference
Browse files Browse the repository at this point in the history
  • Loading branch information
juliangut committed Apr 23, 2016
1 parent d879cba commit 4ae39a2
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/SessionWare.php
Expand Up @@ -208,17 +208,17 @@ protected function configureSessionSavePath()
// @codeCoverageIgnoreEnd
}

$savePath = sys_get_temp_dir();
if (session_save_path() !== '') {
$savePath = rtrim(session_save_path(), DIRECTORY_SEPARATOR);
}
$savePath = trim($this->settings['savePath']);
if ($savePath === '') {
$savePath = sys_get_temp_dir();
if (session_save_path() !== '') {
$savePath = rtrim(session_save_path(), DIRECTORY_SEPARATOR);
}

if (trim($this->settings['savePath']) !== '') {
$savePath = trim($this->settings['savePath']);
} elseif ($this->sessionName !== 'PHPSESSID'
&& $this->sessionName !== array_pop(explode(DIRECTORY_SEPARATOR, $savePath))
) {
$savePath .= DIRECTORY_SEPARATOR . $this->sessionName;
$savePathParts = explode(DIRECTORY_SEPARATOR, $savePath);
if ($this->sessionName !== 'PHPSESSID' && $this->sessionName !== array_pop($savePathParts)) {
$savePath .= DIRECTORY_SEPARATOR . $this->sessionName;
}
}

if (!@mkdir($savePath, 0775, true) && (!is_dir($savePath) || !is_writable($savePath))) {
Expand Down

0 comments on commit 4ae39a2

Please sign in to comment.