fixes https://github.com/owncloud/core/issues/2071
Merge pull request #683 from owncloud/fixing-2071-master

fixes https://github.com/owncloud/core/issues/2071