From 68a94dd2d77fa9e38a298eeea2ec42f2e69699b0 Mon Sep 17 00:00:00 2001 From: Rasmus Fuhse <fuhse@data-quest.de> Date: Thu, 24 Mar 2022 08:33:36 +0100 Subject: [PATCH] re #793 --- app/controllers/oer/endpoints.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/controllers/oer/endpoints.php b/app/controllers/oer/endpoints.php index 9fa119022b7..7e6598d2051 100755 --- a/app/controllers/oer/endpoints.php +++ b/app/controllers/oer/endpoints.php @@ -89,14 +89,14 @@ class Oer_EndpointsController extends StudipController protected function refreshHost($url) { + $host = OERHost::findOneByUrl($url); + if (!$host) { + return; + } $host_data = file_get_contents($url."fetch_public_host_key"); if ($host_data) { $host_data = json_decode($host_data, true); if ($host_data) { - $host = OERHost::findOneByUrl($url); - if (!$host) { - $host = new OERHost(); - } $host['name'] = $host_data['name']; $host['public_key'] = $host_data['public_key']; $host['last_updated'] = time(); -- GitLab