Backport of #7682 to stable6
Merge pull request #8259 from owncloud/backport-7682-6

Backport #7682