MDL-36710 calendar: Correcting the validation checks

This commit is contained in:
Ankit Agarwal
2012-11-27 15:33:36 +08:00
parent cfb59253f6
commit c34e03097a
+4 -2
View File
@@ -122,8 +122,10 @@ class calendar_addsubscription_form extends moodleform {
$errors['importfile'] = get_string('errorrequiredurlorfile', 'calendar');
}
}
} else if (($data['importfrom'] == CALENDAR_IMPORT_FROM_URL) && (clean_param($data['url'], PARAM_URL) !== $data['url'])) {
$errors['url'] = get_string('invalidurl', 'error');
} else if (($data['importfrom'] == CALENDAR_IMPORT_FROM_URL)) {
if (clean_param($data['url'], PARAM_URL) !== $data['url']) {
$errors['url'] = get_string('invalidurl', 'error');
}
} else {
// Shouldn't happen.
$errors['url'] = get_string('errorrequiredurlorfile', 'calendar');