bug: Prevent extending the expiry date of guests set to never expire invitations#2534
Merged
monkeyiq merged 1 commit intofilesender:development3from Feb 7, 2026
Conversation
…by adding a backend check and hiding the frontend UI button.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR fixes a bug where extending a guest invitation that is set to "Never expire" results in the expiration date being reset to the Unix Epoch (Feb 1, 1970), causing the invitation to expire immediately.
The Problem
When a guest invitation is created with the "does not expire" option, its
expiresfield is stored asnull(or 0).When the "Extend" action is triggered:
DBObject::extendObjectExpiryDate) adds the extension duration (e.g., 30 days) to the currentexpiresvalue.expiresis 0/null, the calculation becomes0 + duration.Root cause: The system allows extending a date that doesn't exist (infinite), and the math operation treats "infinite" as zero.
The Solution
I have implemented a safeguard in both the frontend and backend to prevent this action for non-expiring guests.
Frontend (guests_table.php & guests_table.js):
data-does-not-expireattribute to the guest rows.Backend (RestEndpointGuest.class.php):
does_not_expireset to true, the server throws aRestBadParameterException. This prevents API calls (intentional or accidental) from corrupting the date.Files Modified
does_not_expirestatus to the DOM.Type of change