Backport #7259 to stable5

Fixed version of https://github.com/owncloud/core/pull/7361

@karlitschek Please review.