mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-24 19:18:44 +02:00
N°3985 - Performance checks on the back end - Fix Session helper
This commit is contained in:
@@ -110,20 +110,21 @@ class Session
|
|||||||
*/
|
*/
|
||||||
public static function Get($key, $default = null)
|
public static function Get($key, $default = null)
|
||||||
{
|
{
|
||||||
$aSession = $_SESSION;
|
if (isset($_SESSION)) {
|
||||||
$sSessionVar = &$aSession;
|
$aSession = $_SESSION;
|
||||||
if (is_array($key)) {
|
$sSessionVar = &$aSession;
|
||||||
foreach ($key as $SKey) {
|
if (is_array($key)) {
|
||||||
$sSessionVar = &$sSessionVar[$SKey];
|
foreach ($key as $SKey) {
|
||||||
|
$sSessionVar = &$sSessionVar[$SKey];
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$sSessionVar = &$sSessionVar[$key];
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
$sSessionVar = &$sSessionVar[$key];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isset($sSessionVar)) {
|
if (isset($sSessionVar)) {
|
||||||
return $sSessionVar;
|
return $sSessionVar;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $default;
|
return $default;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -134,6 +135,10 @@ class Session
|
|||||||
*/
|
*/
|
||||||
public static function IsSet($key): bool
|
public static function IsSet($key): bool
|
||||||
{
|
{
|
||||||
|
if (!isset($_SESSION)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
$aSession = $_SESSION;
|
$aSession = $_SESSION;
|
||||||
$sSessionVar = &$aSession;
|
$sSessionVar = &$aSession;
|
||||||
if (is_array($key)) {
|
if (is_array($key)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user