Skip to content

Updating enforced expiration date validation mixed up between user and link shares #26197

Closed

Description

Steps

  1. Go to the settings page
  2. For internal shares, set expiration days to "7" and enable enforcement
  3. For link shares, set expiration days to "3" (a lower value) and enable enforcement.
  4. Go to files app
  5. Create a folder "test"
  6. Share "test" with another user
  7. Check expiration date and confirm that it's 7 days in the future from today
  8. Now edit the date and set it to 6 days and confirm

Expected result

6 days is allowed too

Actual result

Error messages from the link share appears with a 3 day limit:
image

Version

22.0.0 alpha git master a186d08

Analysis

The reason is because of a code mix up in Share20/Manager.php where the wrong validator is used: https://github.com/nextcloud/server/blob/master/lib/private/Share20/Manager.php#L978

validateExpirationDate is actually for links.
validateExpirationDateInternal is for user and group shares.
Due to confusing name

Found while working on #25320 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions