From 7abfda4f19400d0af4de8ba9af16d32b5a017d7c Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Sun, 25 Sep 2022 21:03:44 +0200 Subject: [PATCH] refactoring --- lam/templates/tools/serverInfo.php | 2 +- phpstan.neon | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/lam/templates/tools/serverInfo.php b/lam/templates/tools/serverInfo.php index a57ff057a..f0c99509f 100644 --- a/lam/templates/tools/serverInfo.php +++ b/lam/templates/tools/serverInfo.php @@ -52,7 +52,7 @@ $dynamicSubtrees = ''; $result = ldap_read($_SESSION['ldap']->server(), '', 'objectclass=*', array('+', '*', 'subschemasubentry'), 0, 0, 0, LDAP_DEREF_NEVER); if ($result) { $info = ldap_get_entries($_SESSION['ldap']->server(), $result); - if ($info) { + if (is_array($info) && is_array($info[0])) { $info = $info[0]; foreach ($info as $key => $value) { if (is_array($info[$key]) && isset($info[$key]['count'])) { diff --git a/phpstan.neon b/phpstan.neon index 28c40b504..0e05534ce 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -28,8 +28,6 @@ parameters: - '#Cannot assign new offset to array\|string.#' - '#Cannot access offset .* on array\|int.#' - '#Parameter \#1 \$haystack of function strpos expects string, int\|string given.#' - - '#Argument of an invalid type array\|int supplied for foreach, only iterables are supported.#' - - '#Cannot access offset mixed on non-empty-array\|int.#' - '#Parameter \#1 \$ldap of function ldap_get_values_len expects LDAP\\Connection, resource given.#' - '#Parameter \#2 \$result of function ldap_first_entry expects LDAP\\Result, array\|LDAP\\Result given.#' - '#Parameter \#1 \$ldap of function ldap_first_entry expects LDAP\\Connection, resource given.#'