diff options
| author | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2023-04-04 08:04:46 +0000 |
|---|---|---|
| committer | David Siegfried <david.siegfried@uni-vechta.de> | 2023-04-04 08:04:46 +0000 |
| commit | ccabee1bf04881fe9f847cfb33691d9a7b757065 (patch) | |
| tree | 4ad1f2bae98dbbc0f632d470050928cb4732dbbb /lib | |
| parent | 3bbd143efd807a7cc0c7183b0e4c782b80478c3c (diff) | |
fixes #2508
Closes #2508
Merge request studip/studip!1696
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/models/OERHost.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/models/OERHost.php b/lib/models/OERHost.php index 27de21a..bf8f483 100644 --- a/lib/models/OERHost.php +++ b/lib/models/OERHost.php @@ -99,7 +99,7 @@ class OERHost extends OERIdentity public function fetchPublicKey() { $endpoint_url = $this['url']."fetch_public_host_key"; - $endpoint_url .= "?from=".urlencode($GLOBALS['oer_PREFERRED_URI'] ?: $GLOBALS['ABSOLUTE_URI_STUDIP']."dispatch.php/oer/endpoints/"); + $endpoint_url .= "?from=".urlencode($GLOBALS['oer_PREFERRED_URI'] ?? $GLOBALS['ABSOLUTE_URI_STUDIP']."dispatch.php/oer/endpoints/"); $host_data = @file_get_contents($endpoint_url, false, get_default_http_stream_context($endpoint_url)); if ($host_data) { $host_data = json_decode($host_data, true); @@ -123,9 +123,9 @@ class OERHost extends OERIdentity public function askKnownHosts() { $endpoint_url = $this['url']."fetch_known_hosts" - ."?from=".urlencode(!empty($GLOBALS['oer_PREFERRED_URI']) ?: $GLOBALS['ABSOLUTE_URI_STUDIP']."dispatch.php/oer/endpoints/"); + ."?from=".urlencode($GLOBALS['oer_PREFERRED_URI'] ?? $GLOBALS['ABSOLUTE_URI_STUDIP']."dispatch.php/oer/endpoints/"); $output = @file_get_contents($endpoint_url, false, get_default_http_stream_context($endpoint_url)); - if (!empty($output)) { + if ($output) { $output = json_decode($output, true); foreach ((array) $output['hosts'] as $host_data) { $host = OERHost::findOneByUrl($host_data['url']); |
