mirror of
https://github.com/friendica/friendica
synced 2025-04-26 15:10:11 +00:00
Fix missing $_SESSION variable in src/App
This commit is contained in:
parent
d9c6c919e8
commit
45de8a28cd
2 changed files with 20 additions and 9 deletions
|
@ -45,9 +45,24 @@ class Session
|
|||
return isset($_SESSION[$name]);
|
||||
}
|
||||
|
||||
public static function get($name)
|
||||
/**
|
||||
* Retrieves a key from the session super global or the defaults if the key is missing or the value is falsy.
|
||||
*
|
||||
* Handle the case where session_start() hasn't been called and the super global isn't available.
|
||||
*
|
||||
* @param string $name
|
||||
* @param mixed $defaults
|
||||
* @return mixed
|
||||
*/
|
||||
public static function get($name, $defaults = null)
|
||||
{
|
||||
return defaults($_SESSION, $name, null);
|
||||
if (isset($_SESSION)) {
|
||||
$return = defaults($_SESSION, $name, $defaults);
|
||||
} else {
|
||||
$return = $defaults;
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
public static function set($name, $value)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue