summaryrefslogtreecommitdiffstats
path: root/system/libraries
diff options
context:
space:
mode:
Diffstat (limited to 'system/libraries')
-rw-r--r--system/libraries/Email.php41
-rwxr-xr-xsystem/libraries/Session/drivers/Session_cookie.php2
-rwxr-xr-xsystem/libraries/Session/drivers/Session_native.php2
3 files changed, 2 insertions, 43 deletions
diff --git a/system/libraries/Email.php b/system/libraries/Email.php
index fa1d5e9bf..08057f2f7 100644
--- a/system/libraries/Email.php
+++ b/system/libraries/Email.php
@@ -1754,47 +1754,6 @@ class CI_Email {
// --------------------------------------------------------------------
/**
- * Get IP
- *
- * @return string
- */
- protected function _get_ip()
- {
- if ($this->_IP !== FALSE)
- {
- return $this->_IP;
- }
-
- $cip = ( ! empty($_SERVER['HTTP_CLIENT_IP'])) ? $_SERVER['HTTP_CLIENT_IP'] : FALSE;
- $rip = ( ! empty($_SERVER['REMOTE_ADDR'])) ? $_SERVER['REMOTE_ADDR'] : FALSE;
- if ($cip) $this->_IP = $cip;
- elseif ($rip) $this->_IP = $rip;
- else
- {
- $fip = ( ! empty($_SERVER['HTTP_X_FORWARDED_FOR'])) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : FALSE;
- if ($fip)
- {
- $this->_IP = $fip;
- }
- }
-
- if (strpos($this->_IP, ',') !== FALSE)
- {
- $x = explode(',', $this->_IP);
- $this->_IP = end($x);
- }
-
- if ( ! preg_match('/^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$/', $this->_IP))
- {
- $this->_IP = '0.0.0.0';
- }
-
- return $this->_IP;
- }
-
- // --------------------------------------------------------------------
-
- /**
* Get Debug Message
*
* @return string
diff --git a/system/libraries/Session/drivers/Session_cookie.php b/system/libraries/Session/drivers/Session_cookie.php
index fb62c7ec4..5bb1f7aa6 100755
--- a/system/libraries/Session/drivers/Session_cookie.php
+++ b/system/libraries/Session/drivers/Session_cookie.php
@@ -405,7 +405,7 @@ class CI_Session_cookie extends CI_Session_driver {
}
// Is the session current?
- if (($session['last_activity'] + $this->sess_expiration) < $this->now)
+ if (($session['last_activity'] + $this->sess_expiration) < $this->now OR $session['last_activity'] > $this->now)
{
$this->sess_destroy();
return FALSE;
diff --git a/system/libraries/Session/drivers/Session_native.php b/system/libraries/Session/drivers/Session_native.php
index 8d5e51546..6529d4c36 100755
--- a/system/libraries/Session/drivers/Session_native.php
+++ b/system/libraries/Session/drivers/Session_native.php
@@ -107,7 +107,7 @@ class CI_Session_native extends CI_Session_driver {
// Check session expiration, ip, and agent
$now = time();
$destroy = FALSE;
- if (isset($_SESSION['last_activity']) && ($_SESSION['last_activity'] + $expire) < $now)
+ if (isset($_SESSION['last_activity']) && (($_SESSION['last_activity'] + $expire) < $now OR $_SESSION['last_activity'] > $now))
{
// Expired - destroy
$destroy = TRUE;