You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by sh...@apache.org on 2015/09/04 18:10:40 UTC

ios commit: CB-9613 - CDVWhitelist::matches crashes when there is no hostname in a URL

Repository: cordova-ios
Updated Branches:
  refs/heads/master 99f5a3361 -> 6523e1458


CB-9613 - CDVWhitelist::matches crashes when there is no hostname in a URL


Project: http://git-wip-us.apache.org/repos/asf/cordova-ios/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-ios/commit/6523e145
Tree: http://git-wip-us.apache.org/repos/asf/cordova-ios/tree/6523e145
Diff: http://git-wip-us.apache.org/repos/asf/cordova-ios/diff/6523e145

Branch: refs/heads/master
Commit: 6523e1458dcbc2ae3e70a8eda7cb005ca47bc018
Parents: 99f5a33
Author: Shazron Abdullah <sh...@gmail.com>
Authored: Fri Sep 4 09:10:36 2015 -0700
Committer: Shazron Abdullah <sh...@gmail.com>
Committed: Fri Sep 4 09:10:36 2015 -0700

----------------------------------------------------------------------
 CordovaLib/Classes/Public/CDVWhitelist.m | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/6523e145/CordovaLib/Classes/Public/CDVWhitelist.m
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/Public/CDVWhitelist.m b/CordovaLib/Classes/Public/CDVWhitelist.m
index 8e3be75..35fb225 100644
--- a/CordovaLib/Classes/Public/CDVWhitelist.m
+++ b/CordovaLib/Classes/Public/CDVWhitelist.m
@@ -64,7 +64,7 @@ NSString* const kCDVDefaultSchemeName = @"cdv-default-scheme";
         } else {
             _scheme = [NSRegularExpression regularExpressionWithPattern:[CDVWhitelistPattern regexFromPattern:scheme allowWildcards:NO] options:NSRegularExpressionCaseInsensitive error:nil];
         }
-        if ([host isEqualToString:@"*"]) {
+        if ([host isEqualToString:@"*"] || host == nil) {
             _host = nil;
         } else if ([host hasPrefix:@"*."]) {
             _host = [NSRegularExpression regularExpressionWithPattern:[NSString stringWithFormat:@"([a-z0-9.-]*\\.)?%@", [CDVWhitelistPattern regexFromPattern:[host substringFromIndex:2] allowWildcards:false]] options:NSRegularExpressionCaseInsensitive error:nil];


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org