Skip to content
Snippets Groups Projects
Commit ccabee1b authored by Jan-Hendrik Willms's avatar Jan-Hendrik Willms Committed by David Siegfried
Browse files

fixes #2508

Closes #2508

Merge request studip/studip!1696
parent 3bbd143e
No related branches found
No related tags found
No related merge requests found
...@@ -99,7 +99,7 @@ class OERHost extends OERIdentity ...@@ -99,7 +99,7 @@ class OERHost extends OERIdentity
public function fetchPublicKey() public function fetchPublicKey()
{ {
$endpoint_url = $this['url']."fetch_public_host_key"; $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)); $host_data = @file_get_contents($endpoint_url, false, get_default_http_stream_context($endpoint_url));
if ($host_data) { if ($host_data) {
$host_data = json_decode($host_data, true); $host_data = json_decode($host_data, true);
...@@ -123,9 +123,9 @@ class OERHost extends OERIdentity ...@@ -123,9 +123,9 @@ class OERHost extends OERIdentity
public function askKnownHosts() public function askKnownHosts()
{ {
$endpoint_url = $this['url']."fetch_known_hosts" $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)); $output = @file_get_contents($endpoint_url, false, get_default_http_stream_context($endpoint_url));
if (!empty($output)) { if ($output) {
$output = json_decode($output, true); $output = json_decode($output, true);
foreach ((array) $output['hosts'] as $host_data) { foreach ((array) $output['hosts'] as $host_data) {
$host = OERHost::findOneByUrl($host_data['url']); $host = OERHost::findOneByUrl($host_data['url']);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment