Backport #1234 by @MTGap
Merge pull request #1249 from owncloud/backport_1234

Backport #1234