CB-14048: (android) allowedSchemes check empty string fix

This commit is contained in:
Wojciech Trocki 2018-04-27 00:07:57 +01:00
parent 5581957078
commit 57eda786e0

View File

@ -1114,9 +1114,11 @@ 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]*://.*?$")) {
if (allowedSchemes == null) {
String allowed = preferences.getString("AllowedSchemes", "");
String allowed = preferences.getString("AllowedSchemes", null);
if(allowed != null) {
allowedSchemes = allowed.split(",");
}
}
if (allowedSchemes != null) {
for (String scheme : allowedSchemes) {
if (url.startsWith(scheme)) {