summaryrefslogtreecommitdiffstats
path: root/system/libraries
diff options
context:
space:
mode:
Diffstat (limited to 'system/libraries')
-rw-r--r--system/libraries/Cache/drivers/Cache_redis.php8
-rw-r--r--system/libraries/Cache/drivers/Cache_wincache.php2
-rw-r--r--system/libraries/Cache/drivers/index.html3
-rw-r--r--system/libraries/Cache/index.html3
-rw-r--r--system/libraries/Email.php13
-rw-r--r--system/libraries/Javascript/index.html3
-rw-r--r--system/libraries/Session/Session.php4
-rw-r--r--system/libraries/Session/drivers/Session_database_driver.php2
-rw-r--r--system/libraries/Session/drivers/Session_files_driver.php4
-rw-r--r--system/libraries/Session/drivers/Session_memcached_driver.php2
-rw-r--r--system/libraries/Session/drivers/Session_redis_driver.php4
-rw-r--r--system/libraries/Session/drivers/index.html3
-rw-r--r--system/libraries/Session/index.html3
-rw-r--r--system/libraries/index.html3
14 files changed, 37 insertions, 20 deletions
diff --git a/system/libraries/Cache/drivers/Cache_redis.php b/system/libraries/Cache/drivers/Cache_redis.php
index f2a41cc67..5236556d9 100644
--- a/system/libraries/Cache/drivers/Cache_redis.php
+++ b/system/libraries/Cache/drivers/Cache_redis.php
@@ -243,15 +243,13 @@ class CI_Cache_redis extends CI_Driver
*/
public function is_supported()
{
- if (extension_loaded('redis'))
- {
- return $this->_setup_redis();
- }
- else
+ if ( ! extension_loaded('redis'))
{
log_message('debug', 'The Redis extension must be loaded to use Redis cache.');
return FALSE;
}
+
+ return $this->_setup_redis();
}
// ------------------------------------------------------------------------
diff --git a/system/libraries/Cache/drivers/Cache_wincache.php b/system/libraries/Cache/drivers/Cache_wincache.php
index 528b2b9bf..9cc6ff016 100644
--- a/system/libraries/Cache/drivers/Cache_wincache.php
+++ b/system/libraries/Cache/drivers/Cache_wincache.php
@@ -194,7 +194,7 @@ class CI_Cache_wincache extends CI_Driver {
*/
public function is_supported()
{
- if ( ! extension_loaded('wincache'))
+ if ( ! extension_loaded('wincache') OR ! ini_get('wincache.ucenabled'))
{
log_message('debug', 'The Wincache PHP extension must be loaded to use Wincache Cache.');
return FALSE;
diff --git a/system/libraries/Cache/drivers/index.html b/system/libraries/Cache/drivers/index.html
index c942a79ce..b702fbc39 100644
--- a/system/libraries/Cache/drivers/index.html
+++ b/system/libraries/Cache/drivers/index.html
@@ -1,3 +1,4 @@
+<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
@@ -7,4 +8,4 @@
<p>Directory access is forbidden.</p>
</body>
-</html> \ No newline at end of file
+</html>
diff --git a/system/libraries/Cache/index.html b/system/libraries/Cache/index.html
index c942a79ce..b702fbc39 100644
--- a/system/libraries/Cache/index.html
+++ b/system/libraries/Cache/index.html
@@ -1,3 +1,4 @@
+<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
@@ -7,4 +8,4 @@
<p>Directory access is forbidden.</p>
</body>
-</html> \ No newline at end of file
+</html>
diff --git a/system/libraries/Email.php b/system/libraries/Email.php
index 4e0e0cd9f..45c5c09b9 100644
--- a/system/libraries/Email.php
+++ b/system/libraries/Email.php
@@ -2172,11 +2172,22 @@ class CI_Email {
/**
* Get Hostname
*
+ * There are only two legal types of hostname - either a fully
+ * qualified domain name (eg: "mail.example.com") or an IP literal
+ * (eg: "[1.2.3.4]").
+ *
+ * @link https://tools.ietf.org/html/rfc5321#section-2.3.5
+ * @link http://cbl.abuseat.org/namingproblems.html
* @return string
*/
protected function _get_hostname()
{
- return isset($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : 'localhost.localdomain';
+ if (isset($_SERVER['SERVER_NAME']))
+ {
+ return $_SERVER['SERVER_NAME'];
+ }
+
+ return isset($_SERVER['SERVER_ADDR']) ? '['.$_SERVER['SERVER_ADDR'].']' : '[127.0.0.1]';
}
// --------------------------------------------------------------------
diff --git a/system/libraries/Javascript/index.html b/system/libraries/Javascript/index.html
index c942a79ce..b702fbc39 100644
--- a/system/libraries/Javascript/index.html
+++ b/system/libraries/Javascript/index.html
@@ -1,3 +1,4 @@
+<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
@@ -7,4 +8,4 @@
<p>Directory access is forbidden.</p>
</body>
-</html> \ No newline at end of file
+</html>
diff --git a/system/libraries/Session/Session.php b/system/libraries/Session/Session.php
index ba1919b44..f3b819af9 100644
--- a/system/libraries/Session/Session.php
+++ b/system/libraries/Session/Session.php
@@ -153,7 +153,7 @@ class CI_Session {
}
elseif ($_SESSION['__ci_last_regenerate'] < (time() - $regenerate_time))
{
- $this->sess_regenerate(FALSE);
+ $this->sess_regenerate((bool) config_item('sess_regenerate_destroy'));
}
}
// Another work-around ... PHP doesn't seem to send the session cookie
@@ -314,7 +314,7 @@ class CI_Session {
$this->_config = $params;
// Security is king
- ini_set('session.use_trans_id', 0);
+ ini_set('session.use_trans_sid', 0);
ini_set('session.use_strict_mode', 1);
ini_set('session.use_cookies', 1);
ini_set('session.use_only_cookies', 1);
diff --git a/system/libraries/Session/drivers/Session_database_driver.php b/system/libraries/Session/drivers/Session_database_driver.php
index 20cec00fd..f496b4fe0 100644
--- a/system/libraries/Session/drivers/Session_database_driver.php
+++ b/system/libraries/Session/drivers/Session_database_driver.php
@@ -122,7 +122,7 @@ class CI_Session_database_driver extends CI_Session_driver implements SessionHan
public function open($save_path, $name)
{
return empty($this->_db->conn_id)
- ? ( ! $this->_db->autoinit && $this->_db->db_connect())
+ ? (bool) $this->_db->db_connect()
: TRUE;
}
diff --git a/system/libraries/Session/drivers/Session_files_driver.php b/system/libraries/Session/drivers/Session_files_driver.php
index 5852277e8..74528e9d2 100644
--- a/system/libraries/Session/drivers/Session_files_driver.php
+++ b/system/libraries/Session/drivers/Session_files_driver.php
@@ -299,7 +299,9 @@ class CI_Session_files_driver extends CI_Session_driver implements SessionHandle
{
if ($this->close())
{
- return unlink($this->_file_path.$session_id) && $this->_cookie_destroy();
+ return file_exists($this->_file_path.$session_id)
+ ? (unlink($this->_file_path.$session_id) && $this->_cookie_destroy())
+ : TRUE;
}
elseif ($this->_file_path !== NULL)
{
diff --git a/system/libraries/Session/drivers/Session_memcached_driver.php b/system/libraries/Session/drivers/Session_memcached_driver.php
index 600b8ca66..f1a6e2400 100644
--- a/system/libraries/Session/drivers/Session_memcached_driver.php
+++ b/system/libraries/Session/drivers/Session_memcached_driver.php
@@ -361,7 +361,7 @@ class CI_Session_memcached_driver extends CI_Session_driver implements SessionHa
{
if ( ! $this->_memcached->delete($this->_lock_key) && $this->_memcached->getResultCode() !== Memcached::RES_NOTFOUND)
{
- log_message('error', 'Session: Error while trying to free lock for '.$this->_key_prefix.$session_id);
+ log_message('error', 'Session: Error while trying to free lock for '.$this->_lock_key);
return FALSE;
}
diff --git a/system/libraries/Session/drivers/Session_redis_driver.php b/system/libraries/Session/drivers/Session_redis_driver.php
index c3c75b3b6..5fbb5222c 100644
--- a/system/libraries/Session/drivers/Session_redis_driver.php
+++ b/system/libraries/Session/drivers/Session_redis_driver.php
@@ -272,7 +272,7 @@ class CI_Session_redis_driver extends CI_Session_driver implements SessionHandle
{
if (isset($this->_redis, $this->_lock_key))
{
- if ($this->_redis->delete($this->_key_prefix.$session_id) !== 1)
+ if (($result = $this->_redis->delete($this->_key_prefix.$session_id)) !== 1)
{
log_message('debug', 'Session: Redis::delete() expected to return 1, got '.var_export($result, TRUE).' instead.');
}
@@ -381,7 +381,7 @@ class CI_Session_redis_driver extends CI_Session_driver implements SessionHandle
{
if ( ! $this->_redis->delete($this->_lock_key))
{
- log_message('error', 'Session: Error while trying to free lock for '.$this->_key_prefix.$session_id);
+ log_message('error', 'Session: Error while trying to free lock for '.$this->_lock_key);
return FALSE;
}
diff --git a/system/libraries/Session/drivers/index.html b/system/libraries/Session/drivers/index.html
index c942a79ce..b702fbc39 100644
--- a/system/libraries/Session/drivers/index.html
+++ b/system/libraries/Session/drivers/index.html
@@ -1,3 +1,4 @@
+<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
@@ -7,4 +8,4 @@
<p>Directory access is forbidden.</p>
</body>
-</html> \ No newline at end of file
+</html>
diff --git a/system/libraries/Session/index.html b/system/libraries/Session/index.html
index c942a79ce..b702fbc39 100644
--- a/system/libraries/Session/index.html
+++ b/system/libraries/Session/index.html
@@ -1,3 +1,4 @@
+<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
@@ -7,4 +8,4 @@
<p>Directory access is forbidden.</p>
</body>
-</html> \ No newline at end of file
+</html>
diff --git a/system/libraries/index.html b/system/libraries/index.html
index c942a79ce..b702fbc39 100644
--- a/system/libraries/index.html
+++ b/system/libraries/index.html
@@ -1,3 +1,4 @@
+<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
@@ -7,4 +8,4 @@
<p>Directory access is forbidden.</p>
</body>
-</html> \ No newline at end of file
+</html>