mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 00:16:46 +02:00
registration MDL-25135 fix registration when private hub url has a trailing "/" character
This commit is contained in:
parent
b11837c97e
commit
8714216819
1 changed files with 4 additions and 3 deletions
|
@ -41,10 +41,11 @@ require_once($CFG->dirroot . '/' . $CFG->admin . '/registration/lib.php');
|
|||
|
||||
admin_externalpage_setup('registrationindex');
|
||||
|
||||
$huburl = optional_param('huburl', '', PARAM_URL);
|
||||
$huburl = required_param('huburl', PARAM_URL);
|
||||
$huburl = rtrim($huburl, "/");
|
||||
$password = optional_param('password', '', PARAM_TEXT);
|
||||
$hubname = optional_param('hubname', '', PARAM_TEXT);
|
||||
if (empty($huburl) or !confirm_sesskey()) {
|
||||
if (!confirm_sesskey()) {
|
||||
throw new moodle_exception('missingparameter');
|
||||
}
|
||||
|
||||
|
@ -132,7 +133,7 @@ if (!empty($fromform) and empty($update) and confirm_sesskey()) {
|
|||
//we save the token into the communication table in order to have a reference
|
||||
$unconfirmedhub = new stdClass();
|
||||
$unconfirmedhub->token = get_site_identifier();
|
||||
$unconfirmedhub->huburl = rtrim($huburl, "/");
|
||||
$unconfirmedhub->huburl = $huburl;
|
||||
$unconfirmedhub->hubname = $hubname;
|
||||
$unconfirmedhub->confirmed = 0;
|
||||
$unconfirmedhub->id = $registrationmanager->add_registeredhub($unconfirmedhub);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue