Skip to content
Snippets Groups Projects
Unverified Commit b4e7ee4e authored by Ryan Smith's avatar Ryan Smith Committed by GitHub
Browse files

fix: Fixes endpoint correction to close #184. (#187)

parent d6d987bf
No related branches found
No related tags found
No related merge requests found
......@@ -18,9 +18,11 @@ namespace src\loader\lrs;
defined('MOODLE_INTERNAL') || die();
function correct_endpoint($endpoint) {
$nostatements = trim($endpoint, 'statements');
$noslash = trim($nostatements, '/');
return $noslash;
$endswithstatements = substr($endpoint, -11) === "/statements";
if ($endswithstatements) {
return substr($endpoint, 0, -11);
}
return rtrim($endpoint, '/');
}
function load_transormed_events_to_lrs(array $config, array $transformedevents) {
......
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