mirror of
https://gitlab.com/davical-project/davical.git
synced 2026-08-29 18:26:05 +00:00
Don't allow PUT of non-calendar/address resources into calendars/addressbooks.
This commit is contained in:
parent
5d14ab0fe0
commit
2f38cf077b
@ -25,6 +25,12 @@ $lock_opener = $request->FailIfLocked();
|
||||
$dest = new DAVResource($request->path);
|
||||
|
||||
$container = $dest->FetchParentContainer();
|
||||
if ( $container->IsCalendar() ) {
|
||||
$request->DoResponse( 409, translate('Incorrect content type for calendar: ') . $request->content_type );
|
||||
}
|
||||
else if ( $container->IsAddressbook() ) {
|
||||
$request->DoResponse( 409, translate('Incorrect content type for addressbook: ') . $request->content_type );
|
||||
}
|
||||
if ( ! $dest->Exists() ) {
|
||||
if ( $container->IsPrincipal() ) {
|
||||
$request->DoResponse(403,translate('A DAViCal principal collection may only contain collections'));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user