mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-08 11:33:55 +09:00
Fix warning when session is used on CLI
This commit is contained in:
parent
c27a1d803b
commit
99c905a6f4
1 changed files with 5 additions and 5 deletions
|
|
@ -74,7 +74,7 @@ class Session
|
||||||
|
|
||||||
// Set session parameters.
|
// Set session parameters.
|
||||||
list($lifetime, $refresh_interval, $domain, $path, $secure, $httponly, $samesite) = self::_getParams();
|
list($lifetime, $refresh_interval, $domain, $path, $secure, $httponly, $samesite) = self::_getParams();
|
||||||
$alt_domain = $domain ?: preg_replace('/:\\d+$/', '', strtolower($_SERVER['HTTP_HOST']));
|
$alt_domain = $domain ?: preg_replace('/:\\d+$/', '', strtolower($_SERVER['HTTP_HOST'] ?? ''));
|
||||||
ini_set('session.gc_maxlifetime', $lifetime > 0 ? $lifetime : 28800);
|
ini_set('session.gc_maxlifetime', $lifetime > 0 ? $lifetime : 28800);
|
||||||
ini_set('session.use_cookies', 1);
|
ini_set('session.use_cookies', 1);
|
||||||
ini_set('session.use_only_cookies', 1);
|
ini_set('session.use_only_cookies', 1);
|
||||||
|
|
@ -417,7 +417,7 @@ class Session
|
||||||
{
|
{
|
||||||
// Get session parameters.
|
// Get session parameters.
|
||||||
list($lifetime, $refresh_interval, $domain, $path, $secure, $httponly, $samesite) = self::_getParams();
|
list($lifetime, $refresh_interval, $domain, $path, $secure, $httponly, $samesite) = self::_getParams();
|
||||||
$alt_domain = $domain ?: preg_replace('/:\\d+$/', '', strtolower($_SERVER['HTTP_HOST']));
|
$alt_domain = $domain ?: preg_replace('/:\\d+$/', '', strtolower($_SERVER['HTTP_HOST'] ?? ''));
|
||||||
$lifetime = $lifetime ? ($lifetime + time()) : 0;
|
$lifetime = $lifetime ? ($lifetime + time()) : 0;
|
||||||
$options = array(
|
$options = array(
|
||||||
'expires' => $lifetime,
|
'expires' => $lifetime,
|
||||||
|
|
@ -617,7 +617,7 @@ class Session
|
||||||
public static function isTrusted()
|
public static function isTrusted()
|
||||||
{
|
{
|
||||||
// Get session parameters.
|
// Get session parameters.
|
||||||
$domain = self::getDomain() ?: preg_replace('/:\\d+$/', '', strtolower($_SERVER['HTTP_HOST']));
|
$domain = self::getDomain() ?: preg_replace('/:\\d+$/', '', strtolower($_SERVER['HTTP_HOST'] ?? ''));
|
||||||
|
|
||||||
// Check the 'trusted' parameter.
|
// Check the 'trusted' parameter.
|
||||||
if ($_SESSION['RHYMIX']['domains'][$domain]['trusted'] > time())
|
if ($_SESSION['RHYMIX']['domains'][$domain]['trusted'] > time())
|
||||||
|
|
@ -819,7 +819,7 @@ class Session
|
||||||
public static function setTrusted($duration = 300)
|
public static function setTrusted($duration = 300)
|
||||||
{
|
{
|
||||||
// Get session parameters.
|
// Get session parameters.
|
||||||
$domain = self::getDomain() ?: preg_replace('/:\\d+$/', '', strtolower($_SERVER['HTTP_HOST']));
|
$domain = self::getDomain() ?: preg_replace('/:\\d+$/', '', strtolower($_SERVER['HTTP_HOST'] ?? ''));
|
||||||
|
|
||||||
// Update the 'trusted' parameter if the current user is logged in.
|
// Update the 'trusted' parameter if the current user is logged in.
|
||||||
if (isset($_SESSION['RHYMIX']['domains'][$domain]) && $_SESSION['RHYMIX']['login'])
|
if (isset($_SESSION['RHYMIX']['domains'][$domain]) && $_SESSION['RHYMIX']['login'])
|
||||||
|
|
@ -1260,7 +1260,7 @@ class Session
|
||||||
$conflict_domains = config('session.conflict_domains') ?: array();
|
$conflict_domains = config('session.conflict_domains') ?: array();
|
||||||
if ($include_current_host)
|
if ($include_current_host)
|
||||||
{
|
{
|
||||||
$conflict_domains[] = '.' . preg_replace('/:\\d+$/', '', strtolower($_SERVER['HTTP_HOST']));
|
$conflict_domains[] = '.' . preg_replace('/:\\d+$/', '', strtolower($_SERVER['HTTP_HOST'] ?? ''));
|
||||||
}
|
}
|
||||||
if (!count($conflict_domains))
|
if (!count($conflict_domains))
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue