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

Guard against incorrect paths #6340

Merged
merged 1 commit into from
Aug 14, 2024
Merged

Conversation

seadowg
Copy link
Member

@seadowg seadowg commented Aug 13, 2024

This makes sure that paths expanded using PathUtils#getAbsoluteFilePath are always pointing at paths with the provided dirPath.

Why is this the best possible solution? Were any other approaches considered?

Not a lot to discuss here! As far as we know there's no valid reason to have a path outside the dirPath expanded.

How does this change affect users? Describe intentional changes to behavior and behavior that could have accidentally been affected by code changes. In other words, what are the regression risks?

Hard to test this specifically. A general check of saving and sending forms is probably worthwhile.

Before submitting this PR, please make sure you have:

  • added or modified tests for any new or changed behavior
  • run ./gradlew connectedAndroidTest (or ./gradlew testLab) and confirmed all checks still pass
  • added a comment above any new strings describing it for translators
  • added any new strings with date formatting to DateFormatsTest
  • verified that any code or assets from external sources are properly credited in comments and/or in the about file.
  • verified that any new UI elements use theme colors. UI Components Style guidelines

@seadowg seadowg changed the base branch from master to v2024.2.x August 13, 2024 16:16
@seadowg seadowg marked this pull request as ready for review August 13, 2024 16:27
@seadowg seadowg requested a review from grzesiek2010 August 13, 2024 16:27
@seadowg seadowg requested a review from grzesiek2010 August 14, 2024 09:25
@grzesiek2010 grzesiek2010 merged commit 5debc9a into getodk:v2024.2.x Aug 14, 2024
6 checks passed
@seadowg seadowg deleted the path-utils branch August 14, 2024 09:56
@seadowg seadowg added the high priority Should be looked at before other PRs/issues label Aug 14, 2024
@WKobus
Copy link

WKobus commented Aug 16, 2024

Tested with Success

Verified on device with Android 14,10

Verified cases:

  • Saving and sending different forms
  • Autosend on/off

seadowg pushed a commit to seadowg/collect that referenced this pull request Aug 22, 2024
seadowg pushed a commit to seadowg/collect that referenced this pull request Aug 23, 2024
grzesiek2010 added a commit to grzesiek2010/collect that referenced this pull request Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
behavior verified high priority Should be looked at before other PRs/issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants