CB-14061: (android) comply with RFC 3986 for custom URL scheme handling

This commit is contained in:
Tim Brust 2018-05-02 20:16:44 +02:00
parent 5581957078
commit f57ede9be2
No known key found for this signature in database
GPG Key ID: C171AF8F3B0A86B3

View File

@ -1112,7 +1112,7 @@ public class InAppBrowser extends CordovaPlugin {
}
}
// Test for whitelisted custom scheme names like mycoolapp:// or twitteroauthresponse:// (Twitter Oauth Response)
else if (!url.startsWith("http:") && !url.startsWith("https:") && url.matches("^[a-z]*://.*?$")) {
else if (!url.startsWith("http:") && !url.startsWith("https:") && url.matches("^[A-Za-z0-9+.-]*://.*?$")) {
if (allowedSchemes == null) {
String allowed = preferences.getString("AllowedSchemes", "");
allowedSchemes = allowed.split(",");