[
https://issues.apache.org/jira/browse/CB-3394?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13659753#comment-13659753
]
Shazron Abdullah edited comment on CB-3394 at 5/16/13 5:45 PM:
---------------------------------------------------------------
Hmm NSPredicate does not like the '\*' pattern, but it does accept '.\*' (0 or
more of any character). Rather than excepting for this, and changing the
pattern, I would break out of the loop here (return YES) if the wildcard
pattern is matched:
Line:
https://github.com/apache/cordova-ios/blob/8fce6749ebce9e1b8d17bfd45add2988dcb4d90b/CordovaLib/Classes/CDVWhitelist.m#L214
Add:
{code}
// if wildcard, break out and allow
if([regex isEqualToString:@"*"]) {
return YES;
}
{code}
was (Author: shazron):
Hmm NSPredicate does not like the '*' pattern, but it does accept '.*' (0
or more of any character). Rather than excepting for this, and changing the
pattern, I would break out of the loop here (return YES) if the wildcard
pattern is matched:
Line:
https://github.com/apache/cordova-ios/blob/8fce6749ebce9e1b8d17bfd45add2988dcb4d90b/CordovaLib/Classes/CDVWhitelist.m#L214
Add:
{code}
// if wildcard, break out and allow
if([regex isEqualToString:@"*"]) {
return YES;
}
{code}
> Cordova iOS crashes when multiple access elements in config.xml
> ---------------------------------------------------------------
>
> Key: CB-3394
> URL: https://issues.apache.org/jira/browse/CB-3394
> Project: Apache Cordova
> Issue Type: Bug
> Components: iOS
> Affects Versions: 2.7.0
> Reporter: Ryan Willoughby
> Assignee: Shazron Abdullah
> Labels: access, config, crash, iOS
> Fix For: 2.8.0
>
>
> The presence of more than one access element in config.xml causes Cordova iOS
> to crash.
> EDIT: one of them has to be a wildcard to cause the crash, see comment.
> <access origin="*" />
> <access origin="build.phonegap.com" />
> It halts with "Thread 1: signal SIGABRT" on the following line of main.m:
> int retVal = UIApplicationMain(argc, argv, nil, @"AppDelegate");
> Traced down to the loadSettings function.
> Full output log:
> 2013-05-14 20:28:59.431 Test270[53246:c07] Multi-tasking -> Device: YES, App:
> YES
> 2013-05-14 20:28:59.435 Test270[53246:c07] -[__NSArrayI addObject:]:
> unrecognized selector sent to instance 0xa2860a0
> 2013-05-14 20:28:59.437 Test270[53246:c07] *** Terminating app due to
> uncaught exception 'NSInvalidArgumentException', reason: '-[__NSArrayI
> addObject:]: unrecognized selector sent to instance 0xa2860a0'
> *** First throw call stack:
> (0x16b012 0x25e4e7e 0x1f64bd 0x15abbc 0x15a94e 0x53eea 0x53151 0x57cae
> 0x56970 0x56a3e 0x30b9 0x485e1e 0x56afe 0x311d 0x2bdb 0x3a4157 0x3a4747
> 0x3a594b 0x3b6cb5 0x3b7beb 0x3a9698 0x3416df9 0x3416ad0 0xe0bf5 0xe0962
> 0x111bb6 0x110f44 0x110e1b 0x3a517a 0x3a6ffc 0x28bc 0x2815 0x1)
> libc++abi.dylib: terminate called throwing an exceptio
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira