-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
[stable28] Respect empty expiryDate value in server
#45604
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
Conversation
expiryDate value in serverexpiryDate value in server
88cd70e to
1975c87
Compare
1975c87 to
f9f4acc
Compare
a9c5950 to
78587cf
Compare
|
Way too many issues came up with back-porting this due to : #44029 being missing, added it. |
|
Dismissing myself due to lack of PHP-knowledge 🦭 |
78587cf to
724a030
Compare
1e53f8c to
88b7e0f
Compare
88b7e0f to
a327aea
Compare
This comment was marked as outdated.
This comment was marked as outdated.
a327aea to
7935ac0
Compare
|
Resolved the conflict in @@ -647,12 +648,18 @@ class ShareAPIController extends OCSController {
}
//Expire date
- if ($expireDate !== '') {
- try {
- $expireDateTime = $this->parseDate($expireDate);
- $share->setExpirationDate($expireDateTime);
- } catch (\Exception $e) {
- throw new OCSNotFoundException($this->l->t('Invalid date, date format must be YYYY-MM-DD'));
+ if ($expireDate !== null) {
+ if ($expireDate !== '') {
+ try {
+ $expireDateTime = $this->parseDate($expireDate);
+ $share->setExpirationDate($expireDateTime);
+ } catch (\Exception $e) {
+ throw new OCSNotFoundException($this->l->t('Invalid date, date format must be YYYY-MM-DD'));
+ }
+ } else {
+ // Client sent empty string for expire date.
+ // Set noExpirationDate to true so overwrite is prevented.
+ $share->setNoExpirationDate(true);
}
}The expire date section was not present previously. |
|
cannot judge the cypress failures. |
Keeps failing ^ |
Signed-off-by: Robin Appelman <[email protected]>
If `expireDate` is an empty string and not `null` then the server should not set a default. Signed-off-by: fenn-cs <[email protected]>
Signed-off-by: fenn-cs <[email protected]>
- Verify that explicitly sending empty `expireDate` param to server overwrite default and sets not expiry date, if non is enforced. - Update tests to avoid converting empty string to date. Signed-off-by: fenn-cs <[email protected]>
7935ac0 to
530b45e
Compare
Backport of #44485 via #45483
Warning, This backport's changes differ from the original and might be incomplete⚠️
Todo
Learn more about backports at https://docs.nextcloud.com/server/stable/go.php?to=developer-backports.