Fix #332 - stable7

Backport of https://github.com/owncloud/documents/pull/333 to stable7