Merge pull request #268 from wtrocki/CB-14048

CB-14048: (android) allowedSchemes check empty string fix
This commit is contained in:
jcesarmobile 2018-05-19 13:49:36 +02:00 committed by GitHub
commit 33aff11f45
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1114,8 +1114,10 @@ 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", "");
allowedSchemes = allowed.split(",");
String allowed = preferences.getString("AllowedSchemes", null);
if(allowed != null) {
allowedSchemes = allowed.split(",");
}
}
if (allowedSchemes != null) {
for (String scheme : allowedSchemes) {