MDL-66582 tool_mobile: Clean URLs from auth plugins
In order to avoid the WebService to break we must double check that URLs coming from auth plugins are valid.
This commit is contained in:
@@ -210,6 +210,12 @@ class api {
|
||||
$identityprovidersdata = \auth_plugin_base::prepare_identity_providers_for_output($identityproviders, $OUTPUT);
|
||||
if (!empty($identityprovidersdata)) {
|
||||
$settings['identityproviders'] = $identityprovidersdata;
|
||||
// Clean URLs to avoid breaking Web Services.
|
||||
// We can't do it in prepare_identity_providers_for_output() because it may break the web output.
|
||||
foreach ($settings['identityproviders'] as &$ip) {
|
||||
$ip['url'] = (!empty($ip['url'])) ? clean_param($ip['url'], PARAM_URL) : '';
|
||||
$ip['iconurl'] = (!empty($ip['iconurl'])) ? clean_param($ip['iconurl'], PARAM_URL) : '';
|
||||
}
|
||||
}
|
||||
|
||||
// If age is verified, return also the admin contact details.
|
||||
|
||||
Reference in New Issue
Block a user