cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agri...@apache.org
Subject ios commit: CB-5658 Fix whitelist crash when URL path has a space.
Date Tue, 17 Dec 2013 02:32:15 GMT
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 <agrieve@chromium.org>
Authored: Mon Dec 16 21:31:44 2013 -0500
Committer: Andrew Grieve <agrieve@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;


Mime
View raw message