Skip to content
This repository has been archived by the owner on Jan 25, 2019. It is now read-only.

Making the URLValueFormatter more resilient #186

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

clacladev
Copy link

Making the URLValueFormatter more resilient.
If the string value passed in the unformatValue is not one representing a valid url, now the URL init is not force unwrapped, so if it fails the code will not crash anymore. The scenario in with the URL creation fails is now managed.
Example input that makes the URLValueFormatter crash is "http://example.com/page1\"" (with an escaped quote at the end).

I also fixed some Swift 3 conversion to string warnings.

clacladev added 2 commits June 7, 2017 15:05
If the string value passed in the unformatValue is not one representing a valid url, now the URL init is not force unwrapped, so if it fails the code will not crash anymore. The scenario in with the URL creation fails is now managed.
Example input that makes the URLValueFormatter crash is "http://example.com/page1\"" (with an escaped quote at the end).
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant