Skip to content

[Bug]: Cannot Adjust Public Share Link Expiration Date Below Maximum Allowed Period #50787

@yemkareems

Description

@yemkareems

⚠️ This issue respects the following points: ⚠️

Bug description

  1. Create a new public share link
  2. Set expiration date to "2025/02/05"
  3. Click "Create share"
    Result: System automatically changes date to "2025/02/12" (14 days maximum)
    Expected: System should accept any date up to the maximum allowed period

Steps to reproduce

  1. I created a new share with a password and expireDate

Image

  1. However in this case the request payload is missing the expireDate attribute{
    "path": "/sharenewfolder",
    "shareType": 3,
    "password": "mjADqFcepJ123456789",
    "attributes": "[]"
    }

Hence it is setting it to default 7 days from today(06/02/2025) and not the original date set by the user ie 20/02/2025.

The 7 days is set in the backend by admin

  1. I tried updating the share and at that time expireDate is getting passed in the request

{
"permissions": "17",
"attributes": "[]",
"note": "",
"expireDate": "2025-02-20",
"label": "",
"password": "3|$argon2id$v=19$m=65536,t=4,p=1$SnlCOC51ZmlvOGM2TEVTSA$vtmy0P8Q0iERCFmECIW4xh+LZFNnJ3wvxxpDCYf48j0",
"hideDownload": "false"
}

So the issue is reproducible while creating the share as explained by the customer. I am on NC 29.0.11. Please check and let me know if you need more information from my side.

Similar bug is reported by one more customer on nc 30.0.5. for some reason i am not able uncheck the password but i unset the enable link expiration

Image

{
"path": "/sharenewfolder",
"shareType": 3,
"password": "FCBezCZ2c6",
"expireDate": "2025-02-06",
"attributes": "[]"
}

Here i see the default expireDate is getting passed in the request although Enable link expiration is unchecked.

When i update the share with the same checkbox unchecked the request is

{
"permissions": "17",
"attributes": "[]",
"note": "",
"expireDate": "",
"label": "",
"password": "3|$argon2id$v=19$m=65536,t=4,p=1$cGhyLkh0Y0NXRzd6Ym54Vg$f+OATGrTVM37ElgCj8bzsvdQi4qHa5RqgVjktcm145s",
"hideDownload": "false"
}

So while creating the share there is a issue as explained by customer. NC 30.0.5. Please check and let me know if you need more info from my side.

Expected behavior

expiryDate set by user should take effect. If no expiryDate is set in second case then the link should not have any expiry date at all

Nextcloud Server version

29

Operating system

None

PHP engine version

None

Web server

None

Database engine version

None

Is this bug present after an update or on a fresh install?

None

Are you using the Nextcloud Server Encryption module?

None

What user-backends are you using?

  • Default user-backend (database)
  • LDAP/ Active Directory
  • SSO - SAML
  • Other

Configuration report

List of activated Apps

Nextcloud Signing status

Nextcloud Logs

Additional info

No response

Metadata

Metadata

Assignees

Type

No type

Projects

Status

☑️ Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions