File: 1031_html-main.php-Fix-bug-where-config-is-a-string-after.patch

package info (click to toggle)
gosa 2.8~git20230203.10abe45%2Bdfsg-19
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 33,108 kB
  • sloc: php: 32,102; javascript: 10,836; pascal: 3,776; xml: 3,135; sh: 852; python: 162; makefile: 45; perl: 2
file content (27 lines) | stat: -rw-r--r-- 921 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
From 240c597c7d21684a2db5b105f56aebddfdfccd57 Mon Sep 17 00:00:00 2001
From: root <root@postoffice.intern>
Date: Tue, 22 Aug 2023 16:06:10 +0200
Subject: [PATCH 07/13] html/main.php: Fix bug where $config is a string after
 a while of AFK. GOsa would show PHP crashing.

Can be amended to existing patch!
---
 html/main.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/html/main.php b/html/main.php
index e46acda..c2b8cf0 100644
--- a/html/main.php
+++ b/html/main.php
@@ -76,7 +76,7 @@ $ui= session::global_get('ui');
 // }
 
 $config = session::global_get('config');
-if (!isset($config)) {
+if (!isset($config) || !is_object($config)) {
   #die("Could not get config object. Please contact your system administrator or try again later.\n");
   new log("security","login","",array(),"main.php called with empty config object. Logging user out.") ;
   header ("Location: logout.php");
-- 
2.39.2