fix https://github.com/owncloud/core/issues/6825

@PVince81 @DeepDiver1975 @schiesbn