Return-Path: X-Original-To: apmail-cordova-commits-archive@www.apache.org Delivered-To: apmail-cordova-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id AEC4D1080F for ; Tue, 17 Dec 2013 02:32:15 +0000 (UTC) Received: (qmail 91939 invoked by uid 500); 17 Dec 2013 02:32:15 -0000 Delivered-To: apmail-cordova-commits-archive@cordova.apache.org Received: (qmail 91891 invoked by uid 500); 17 Dec 2013 02:32:15 -0000 Mailing-List: contact commits-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cordova.apache.org Delivered-To: mailing list commits@cordova.apache.org Received: (qmail 91884 invoked by uid 99); 17 Dec 2013 02:32:15 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Dec 2013 02:32:15 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 4A0A682A6A3; Tue, 17 Dec 2013 02:32:15 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: agrieve@apache.org To: commits@cordova.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: ios commit: CB-5658 Fix whitelist crash when URL path has a space. Date: Tue, 17 Dec 2013 02:32:15 +0000 (UTC) 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 Authored: Mon Dec 16 21:31:44 2013 -0500 Committer: Andrew Grieve 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;