Form Builder can be configured to send a redirect after a submission
form has submitted. Before this change it rebuilt URLs with all the
parts except the port, causing failures on sites that use a non standard
port. After this change, a port is used if there is one.
if (url.indexOf('civicrm/') === 0) {
url = CRM.url(url);
} else if (url.indexOf('/') === 0) {
- url = $location.protocol() + '://' + $location.host() + url;
+ let port = $location.port();
+ port = port ? `:${port}` : '';
+ url = `${$location.protocol()}://${$location.host()}${port}${url}`;
}
$window.location.href = url;
}