Skip to content

Commit f4cd6f3

Browse files
committed
MOBILE-3039 core: Fix old custom URL links in iOS
1 parent b2c63f4 commit f4cd6f3

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/providers/urlschemes.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,6 @@ export class CoreCustomURLSchemesProvider {
125125
// Some sites add a # at the end of the URL. If it's there, remove it.
126126
url = url.replace(/\/?#?\/?$/, '');
127127

128-
// In iOS, the protocol after the scheme doesn't have ":". Add it.
129-
// E.g. "moodlemobile://https://..." is received as "moodlemobile://https//..."
130-
url = url.replace(/\/\/(https?)\/\//, '//$1://');
131-
132128
modal = this.domUtils.showModalLoading();
133129

134130
// Get the data from the URL.
@@ -137,8 +133,14 @@ export class CoreCustomURLSchemesProvider {
137133

138134
return this.getCustomURLTokenData(url);
139135
} else if (this.isCustomURLLink(url)) {
136+
// In iOS, the protocol after the scheme doesn't have ":". Add it.
137+
url = url.replace(/\/\/link=(https?)\/\//, '//link=$1://');
138+
140139
return this.getCustomURLLinkData(url);
141140
} else {
141+
// In iOS, the protocol after the scheme doesn't have ":". Add it.
142+
url = url.replace(/\/\/(https?)\/\//, '//$1://');
143+
142144
return this.getCustomURLData(url);
143145
}
144146
}).then((result) => {

0 commit comments

Comments
 (0)