summaryrefslogtreecommitdiffstats
path: root/system/libraries/Session/Session_driver.php
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2015-12-14 15:42:29 +0100
committerAndrey Andreev <narf@devilix.net>2015-12-14 15:42:29 +0100
commit788fb4aa823179e7c4401f5384207d916697bb7e (patch)
tree551fd91834cc4f259d44d2355638552130ca2749 /system/libraries/Session/Session_driver.php
parent97ecf2fcce8e3133e286e16de1b49612235a8dcf (diff)
parentbc05b84995d5425d6bdc28c43174e70b720840ce (diff)
Merge branch '3.0-stable' into develop
Diffstat (limited to 'system/libraries/Session/Session_driver.php')
-rw-r--r--system/libraries/Session/Session_driver.php23
1 files changed, 23 insertions, 0 deletions
diff --git a/system/libraries/Session/Session_driver.php b/system/libraries/Session/Session_driver.php
index 47376da5b..64b4bb511 100644
--- a/system/libraries/Session/Session_driver.php
+++ b/system/libraries/Session/Session_driver.php
@@ -74,6 +74,18 @@ abstract class CI_Session_driver implements SessionHandlerInterface {
*/
protected $_session_id;
+ /**
+ * Success and failure return values
+ *
+ * Necessary due to a bug in all PHP 5 versions where return values
+ * from userspace handlers are not handled properly. PHP 7 fixes the
+ * bug, so we need to return different values depending on the version.
+ *
+ * @see https://wiki.php.net/rfc/session.user.return-value
+ * @var mixed
+ */
+ protected $_success, $_failure;
+
// ------------------------------------------------------------------------
/**
@@ -85,6 +97,17 @@ abstract class CI_Session_driver implements SessionHandlerInterface {
public function __construct(&$params)
{
$this->_config =& $params;
+
+ if (is_php('7'))
+ {
+ $this->_success = TRUE;
+ $this->_failure = FALSE;
+ }
+ else
+ {
+ $this->_success = 0;
+ $this->_failure = -1;
+ }
}
// ------------------------------------------------------------------------