From cdf8a2f37475400ba56c9f82f853e93dba39a4c3 Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 3 Aug 2020 16:03:51 +0000 Subject: [PATCH 1/2] Fix Notice: " Undefined index: urls in /src/Worker/UpdateServerDirectory.php on line 64" --- src/Worker/UpdateServerDirectory.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Worker/UpdateServerDirectory.php b/src/Worker/UpdateServerDirectory.php index dd94aa52c..90bd5c50a 100644 --- a/src/Worker/UpdateServerDirectory.php +++ b/src/Worker/UpdateServerDirectory.php @@ -61,6 +61,9 @@ class UpdateServerDirectory $urls = []; foreach ($contacts['entry'] as $entry) { + if (empty($entry['urls'])) { + continue; + } foreach ($entry['urls'] as $url_entry) { if (empty($url_entry['type']) || empty($url_entry['value'])) { continue; From 22db644295ada6e2f8e3203cae0e8bebb3ed0377 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Mon, 3 Aug 2020 18:58:12 +0200 Subject: [PATCH 2/2] Update src/Worker/UpdateServerDirectory.php Co-authored-by: Hypolite Petovan --- src/Worker/UpdateServerDirectory.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/Worker/UpdateServerDirectory.php b/src/Worker/UpdateServerDirectory.php index 90bd5c50a..1244e2c2c 100644 --- a/src/Worker/UpdateServerDirectory.php +++ b/src/Worker/UpdateServerDirectory.php @@ -60,11 +60,8 @@ class UpdateServerDirectory Logger::info('PoCo discovery started', ['poco' => $gserver['poco']]); $urls = []; - foreach ($contacts['entry'] as $entry) { - if (empty($entry['urls'])) { - continue; - } - foreach ($entry['urls'] as $url_entry) { + foreach (array_column($contacts['entry'], 'urls') as $urls) { + foreach ($urls as $url_entry) { if (empty($url_entry['type']) || empty($url_entry['value'])) { continue; }