MDL-58943 oauth2: use standard way of URL validation

This commit is contained in:
Jan Dageförde
2018-10-31 10:42:58 +08:00
committed by Damyon Wiese
parent 3e3e120d3a
commit daef88213b
+3 -1
View File
@@ -219,7 +219,9 @@ class issuer extends persistent {
* @return lang_string|boolean
*/
protected function validate_baseurl($value) {
if (!empty($value) && strpos($value, 'https://') !== 0) {
global $CFG;
include_once($CFG->dirroot . '/lib/validateurlsyntax.php');
if (!empty($value) && !validateUrlSyntax($value, 'S+')) {
return new lang_string('sslonlyaccess', 'error');
}
return true;