-
-
Notifications
You must be signed in to change notification settings - Fork 768
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed ISO8601 Crashes #586
Comments
I have the same issue. |
Apparently any deviation from the required ISO format is likely to cause this crash. I had a string in a unit test that was missing the trailing Z and that crashed. Obviously something has changed. These dates were accepted previously. If the intent is for them to not be accepted ISOParser should still not crash. It's supposed to return nil. My workaround for my short dates "2018-08-01" has been to use a DateParser with the matching format. |
Having the same issue on the Xcode 10 GM seed. Does anyone have idea on when this will be resolved? |
This is not related to XCode 10 but it's a bug of the parser. Fixed it and added several other unit tests. |
Are you releasing this fix to 4.x or is it a dead branch? |
Hey @redent, I cherrypicked the fix onto latest 4.x and it fixed my issues. (link to commit above) @malcommac would you consider accepting a PR for this? I imagine there are a decent number of us still on Swift 3.x that need iOS 12 support |
@malcommac Any update on whether or not this change could be PR'd into a 4.x branch? Our project relies heavily on SwiftDate and upgrading to 5.x is not something we can do right now. |
@malcommac Similar to @MrMatthewDavis and @raudabaugh we'd like to ask this fix retrofitted to 4.x if at all possible - for reasons articulated by MrMatthewDavis. SwiftDate 4.3.0 and ISO8601Parser with a date string composed of a year and a week number (e.g. "2019-W13") appears also to crash, please see an example below: |
I'm getting a crash when parsing ISO dates of the form "2018-08-01" on iOS 12 using Xcode beta 6 on the simulator.
Simply adding this line to applicationdidFinishLaunching causes the crash:
let date = ISOParser.date(from: "2017-01-03")
The crash is a "String index is out of bounds" error inside the current() method.
Parsing longer ISO dates works as expected. I haven't updated the code to swift 4.2. Swift version is set to 4. SwiftDate is 5.0.7 and is installed with CocoaPods.
Parsing dateStrings like this has always worked fine on iOS 11 and earlier.
The text was updated successfully, but these errors were encountered: