Don't set Content-Length header if size is unknown
added OC_DB::isError and logging
fixed error rising from fetchRow
added check by numRows()
changed to public api where it was possible
reformat code to comply with the coding guidelines
Merge branch 'master' into file_encryption_util_is_error

Conflicts:
	apps/files_encryption/lib/util.php
fix https://github.com/owncloud/core/issues/3320
add event.preventDefault to undelete function
Merge pull request #3412 from owncloud/fix_2013

Don't set Content-Length header if size is unknown
Merge pull request #3495 from owncloud/file_encryption_util_is_error

added OC_DB::isError and logging for #3486
Merge pull request #3506 from owncloud/fix_3320

fix https://github.com/owncloud/core/issues/3320
Merge branch 'master' into remove_unused_vars

Conflicts:
	apps/files_encryption/lib/util.php
reformat code