MOBILE-3013 core: Support relative URLs in redirect
parent
15aac08bdd
commit
47ac489b24
|
@ -130,7 +130,7 @@ export class CoreCustomURLSchemesProvider {
|
||||||
}).then((result) => {
|
}).then((result) => {
|
||||||
data = result;
|
data = result;
|
||||||
|
|
||||||
if (data.redirect && data.redirect.indexOf(data.siteUrl) == -1) {
|
if (data.redirect && data.redirect.match(/^https?:\/\//) && data.redirect.indexOf(data.siteUrl) == -1) {
|
||||||
// Redirect URL must belong to the same site. Reject.
|
// Redirect URL must belong to the same site. Reject.
|
||||||
return Promise.reject(this.translate.instant('core.contentlinks.errorredirectothersite'));
|
return Promise.reject(this.translate.instant('core.contentlinks.errorredirectothersite'));
|
||||||
}
|
}
|
||||||
|
@ -173,6 +173,11 @@ export class CoreCustomURLSchemesProvider {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (data.redirect && !data.redirect.match(/^https?:\/\//)) {
|
||||||
|
// Redirect is a relative URL. Append the site URL.
|
||||||
|
data.redirect = this.textUtils.concatenatePaths(data.siteUrl, data.redirect);
|
||||||
|
}
|
||||||
|
|
||||||
let promise;
|
let promise;
|
||||||
|
|
||||||
if (siteId) {
|
if (siteId) {
|
||||||
|
|
Loading…
Reference in New Issue