This needs to be done differently, but there are more spots like this in that app. See https://github.com/owncloud/core/issues/1485