feature/session (#3073): Redis driver save_path param parsing fixes
Close #3240
diff --git a/system/libraries/Session/drivers/Session_redis_driver.php b/system/libraries/Session/drivers/Session_redis_driver.php
index d4ce5b2..6d8044d 100644
--- a/system/libraries/Session/drivers/Session_redis_driver.php
+++ b/system/libraries/Session/drivers/Session_redis_driver.php
@@ -81,8 +81,9 @@
{
log_message('error', 'Session: No Redis save path configured.');
}
- elseif (preg_match('#(?:tcp://)?([^:]+)(?:\:(\d+))?(\?.+)?#', $this->_save_path, $matches))
+ elseif (preg_match('#(?:tcp://)?([^:?]+)(?:\:(\d+))?(\?.+)?#', $this->_save_path, $matches))
{
+ isset($matches[3]) OR $matches[3] = ''; // Just to avoid undefined index notices below
$this->_save_path = array(
'host' => $matches[1],
'port' => empty($matches[2]) ? NULL : $matches[2],