mirror of
https://github.com/moodle/moodle.git
synced 2025-08-07 18:06:51 +02:00
Merge branch 'MDL-73868-master' of https://github.com/sarjona/moodle
This commit is contained in:
commit
08d2c0fb9f
1 changed files with 2 additions and 0 deletions
|
@ -76,6 +76,8 @@ class imsbadgeconnect extends base_definition {
|
|||
} else if ($key == 'image' && empty($issuer->get('image'))) {
|
||||
// Update the image with the value in the manifest file if it's valid and empty in the issuer.
|
||||
$url = filter_var($value, FILTER_SANITIZE_URL);
|
||||
// Remove multiple slashes in URL. It will fix the Badgr bug with image URL defined in their manifest.
|
||||
$url = preg_replace('/([^:])(\/{2,})/', '$1/', $url);
|
||||
if (filter_var($url, FILTER_VALIDATE_URL) !== false) {
|
||||
$issuer->set('image', $url);
|
||||
$issuer->update();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue