aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJan-Hendrik Willms <tleilax+studip@gmail.com>2023-04-04 08:04:46 +0000
committerDavid Siegfried <david.siegfried@uni-vechta.de>2023-04-04 08:04:46 +0000
commitccabee1bf04881fe9f847cfb33691d9a7b757065 (patch)
tree4ad1f2bae98dbbc0f632d470050928cb4732dbbb /lib
parent3bbd143efd807a7cc0c7183b0e4c782b80478c3c (diff)
fixes #2508
Closes #2508 Merge request studip/studip!1696
Diffstat (limited to 'lib')
-rw-r--r--lib/models/OERHost.php6
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']);