You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ag...@apache.org on 2013/12/17 03:32:15 UTC

ios commit: CB-5658 Fix whitelist crash when URL path has a space.

Updated Branches:
  refs/heads/master ede9b5334 -> 7452c68c7


CB-5658 Fix whitelist crash when URL path has a space.


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

Branch: refs/heads/master
Commit: 7452c68c73d89285d51b06839dce1dfac8850004
Parents: ede9b53
Author: Andrew Grieve <ag...@chromium.org>
Authored: Mon Dec 16 21:31:44 2013 -0500
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Mon Dec 16 21:31:44 2013 -0500

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


http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/7452c68c/CordovaLib/Classes/CDVWhitelist.m
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVWhitelist.m b/CordovaLib/Classes/CDVWhitelist.m
index 5a9fb7e..0095c55 100644
--- a/CordovaLib/Classes/CDVWhitelist.m
+++ b/CordovaLib/Classes/CDVWhitelist.m
@@ -249,7 +249,7 @@ NSString* const kCDVDefaultSchemeName = @"cdv-default-scheme";
 
     // http[s] and ftp[s] should also validate against the common set in the kCDVDefaultSchemeName list
     if ([scheme isEqualToString:@"http"] || [scheme isEqualToString:@"https"] || [scheme isEqualToString:@"ftp"] || [scheme isEqualToString:@"ftps"]) {
-        NSURL* newUrl = [NSURL URLWithString:[NSString stringWithFormat:@"%@://%@%@", kCDVDefaultSchemeName, [url host], [url path]]];
+        NSURL* newUrl = [NSURL URLWithString:[NSString stringWithFormat:@"%@://%@%@", kCDVDefaultSchemeName, [url host], [[url path] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]];
         // If it is allowed, we are done.  If not, continue to check for the actual scheme-specific list
         if ([self URLIsAllowed:newUrl logFailure:NO]) {
             return YES;