Skip to content
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

Fix issue where urls with special characters were not correctly deserialized #1444

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

overcyn
Copy link
Contributor

@overcyn overcyn commented Jan 21, 2021

ORKPathRelativeToURL and ORKURLForRelativePath do not correctly mirror each other. ORKPathRelativeToURL percent encodes it's output whereas ORKURLForRelativePath does not percent decode it's input. These methods are used during serialization/deserialization, causing a restored ORKFileResult to not point at the same path as the original file result.

Fix is to replace the call to [NSURL fileURLWithFileSystemRepresentation:...] with [NSURL URLWithString:...]. This matches with the [standardizedURL absoluteString] call in ORKPathRelativeToURL. I do not believe it is necessary to check if the file is a directory given that we are not modifying the relative path. If the original url had a trailing slash, then the output path will have a trailing slash and vice versa.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant