-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Allow to directly set the expireDate on a new (link)share #18651
Conversation
Since this extends the API we now properly parse the date. We only accept valid ISO 8601 Dates (YYYY-MM-DD). Currently this only works for link shares (it is just ignored for other shares). Since we do not have user/group/federated expiring shares yet. * Tests added
sweeet 👍 |
*/ | ||
private static function parseDate($expireDate) { | ||
if (preg_match('/^\d{4}-\d{2}-\d{2}$/', $expireDate) === 0) { | ||
throw new \Exception(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add exception message "Invalid date" ?
Works 👍, tested with this pyocclient branch: owncloud/pyocclient#120 |
@rullzer can you fix the comments/strings, then feel free to merge |
👍 It is working fine. |
* Added more intergration tests
21b996e
to
2aff11c
Compare
A new inspection was created. |
Raised doc ticket here: owncloud-archive/documentation#1615 |
Allow to directly set the expireDate on a new (link)share
Now I wonder whether we should backport this. Anyway, API consumers (like pyocclient) will have to work with older OC servers that don't have this API implemented. |
@PVince81 yeah not trivial. But clients will need to handle it properly anyway. Since if sopmebody is still on 8.0.3 is should also work. So I do not think this has to be backported. Clients can check on version number. So that is probably simpler. |
As requested by @PVince81 in #14808 and again in #18631 (comment) ;)
Now it is possible to directly set the expiration date on shares.
TODO: