diff options
author | Andrey Andreev <narf@devilix.net> | 2015-02-02 17:38:00 +0100 |
---|---|---|
committer | Andrey Andreev <narf@devilix.net> | 2015-02-02 17:38:00 +0100 |
commit | 5f4d01a97d9979f25ace6a7bce4dea23f630524e (patch) | |
tree | 0fc40a2e2bb989710429a0b0c42b2ee53a98ca0c /system/libraries | |
parent | 1bd697cd7fcfd99ff292f26e697bb192901e1a41 (diff) |
Throw exception if 'files' session path is invalid
Diffstat (limited to 'system/libraries')
-rw-r--r-- | system/libraries/Session/drivers/Session_files_driver.php | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/system/libraries/Session/drivers/Session_files_driver.php b/system/libraries/Session/drivers/Session_files_driver.php index 04562b282..32aeab614 100644 --- a/system/libraries/Session/drivers/Session_files_driver.php +++ b/system/libraries/Session/drivers/Session_files_driver.php @@ -1,4 +1,4 @@ -<?php +r<?php /** * CodeIgniter * @@ -112,10 +112,16 @@ class CI_Session_files_driver extends CI_Session_driver implements SessionHandle */ public function open($save_path, $name) { - if ( ! is_dir($save_path) && ! mkdir($save_path, 0700, TRUE)) + if ( ! is_dir($save_path)) { - log_message('error', "Session: Configured save path '".$this->_config['save_path']."' is not a directory, doesn't exist or cannot be created."); - return FALSE; + if ( ! mkdir($save_path, 0700, TRUE)) + { + throw new Exception("Session: Configured save path '".$this->_config['save_path']."' is not a directory, doesn't exist or cannot be created."); + } + } + elseif ( ! is_writable($save_path)) + { + throw new Exception("Session: Configured save path '".$this->_config['save_path']."' is not writable by the PHP process."); } $this->_config['save_path'] = $save_path; |