Esri / data-collection-ios

Mobile data collection app using the iOS Runtime SDK.
https://developers.arcgis.com/
Apache License 2.0
25 stars 26 forks source link

App doesn't validate attachment file name #188

Closed codergrl closed 4 years ago

codergrl commented 5 years ago

When renaming a new attachment, the app should validate so the user cannot enter invalid characters like spaces, backslashes, etc. Currently the app allows the user to enter invalid characters, and then it fails to save the attachment throwing a null pointer exception.

Here's the regex used in the dotnet app to validate: ^[^\\\/:*?""<>|\s]+$

nCastle1 commented 4 years ago

I tried the branch with the fix. I noticed that it still allowed me to enter ], but it was saved as _.

unrelated issue

Also, I can't edit several features in Ladd's Circle and Squares; these are editable in WPF and UWP apps, so I'm not sure what's happening. I get the 'invalid fields' message defined on RichPopupManager.swift:57. ![image](https://user-images.githubusercontent.com/29742178/67034399-747f3880-f0cc-11e9-8ebf-1ded95d6ceb7.png) I tried debugging, but Runtime doesn't give any info other than 'Feature isn't valid'. One or two features can be edited, but I'm not seeing the pattern as to why.

nCastle1 commented 4 years ago

It looks like the editing is a separate issue (affects master as well) so I'll open a separate issue.

mhdostal commented 4 years ago

I tried the branch with the fix. I noticed that it still allowed me to enter ], but it was saved as _.

It's fine with me iff there are characters that the system can handle but get translated; it just can't fail to save the attachment.

mhdostal commented 4 years ago

Verified fixed in the v1.1.2 release.