Throw exception if 'files' session path is invalid
diff --git a/system/libraries/Session/drivers/Session_files_driver.php b/system/libraries/Session/drivers/Session_files_driver.php
index 04562b2..32aeab6 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 @@
*/
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;