Skip to content
Snippets Groups Projects
Unverified Commit f9d42cd8 authored by Tobias Reischmann's avatar Tobias Reischmann
Browse files

Fixed error thrown when engageurl empty

parent f86b9932
Branches
No related tags found
No related merge requests found
......@@ -72,8 +72,12 @@ class filter_opencast extends moodle_text_filter {
} else if ($video) {
$video = false;
if (substr($match, 0, 7) === "<source") {
// Get baseurl.
// Get baseurl either from engageurl setting or from opencast tool.
$baseurl = get_config('filter_opencast', 'engageurl');
if (empty($baseurl)) {
$baseurl = get_config('tool_opencast', 'apiurl');
}
// Check if video is from opencast.
if (strpos($match, $baseurl) === false) {
......
......@@ -32,8 +32,12 @@ require_once($CFG->dirroot . '/lib/oauthlib.php');
function filter_opencast_login() {
global $PAGE;
// Get url of opencast engage server.
// Get baseurl for the endpoint either from engageurl setting or from opencast tool.
$endpoint = get_config('filter_opencast', 'engageurl');
if (empty($endpoint)) {
$endpoint = get_config('tool_opencast', 'apiurl');
}
if (strpos($endpoint, 'http') !== 0) {
$endpoint = 'http://' . $endpoint;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment