File: 1060_include-class_acl.inc-Fix-array_keys-being-called-wi.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 (28 lines) | stat: -rw-r--r-- 1,180 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
28
From a37b3cf699596bd154b900ce8f67dbc7b701abdc Mon Sep 17 00:00:00 2001
From: root <root@postoffice.intern>
Date: Tue, 22 Aug 2023 16:09:02 +0200
Subject: [PATCH 08/13] include/class_acl.inc: Fix array_keys being called with
 a string instead of array at param. #1.

Closes: #1049940
---
 include/class_acl.inc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/class_acl.inc b/include/class_acl.inc
index cd77c17..68b0410 100644
--- a/include/class_acl.inc
+++ b/include/class_acl.inc
@@ -673,7 +673,8 @@ class acl extends plugin
                 // Create a map of all used sections, this allows us to simply hide the remove button
                 //  if no acl is configured for the given section
                 // e.g. ';all;department/country;users/user;
-                $usedList = ";".implode(';', array_keys($this->aclContents)).";";
+                $array_keys = array_keys(is_array($this->aclContents) ? $this->aclContents : array());
+                $usedList = ";" . implode(';', $array_keys) . ";";
 
                 /* Add settings for all categories to the (permanent) list */
                 $data = $lData = array();
-- 
2.39.2