Do not write current time before checking if cache is expired
Tests whether expired/valid link share is still accessible.
Perform expiration date checking before returning share data for token.
Improve empty data check
streamCopy() should return proper structure.

Callers of streamCopy() expect an array to be returned containing count and result.

Conflicts:
	lib/helper.php
	tests/lib/helper.php
Merge pull request #5343 from owncloud/backport-5340-stable5

Backport 5340 stable5

* owncloud/backport-5340-stable5:
  streamCopy() should return proper structure.
Merge pull request #5185 from owncloud/Update-feed

[stable5] Fixes for update feed fetching and parsing
Merge pull request #5229 from owncloud/more-link-expiration-stable5

Backport of #4856 to stable5: Fix Sharing "Expiration Date" for Shares of type Link (i.e. Token)
Update file actions for newly created files

The commit d53b603b8259e9c9fe498b4bd50b4dbedc0bf01b for the backport
didn't contain code for the case where new files were created.
This is because that code already existed in OC6 as part of another fix.

This fix adds the missing call to update the file actions for newly
created files.
Fixed upload permissions distinction between public and logged in upload

Backport of 9cfb438ff7fd24ef5c81c4f2e075789d320016e2
Fixed sharing status update for new/uploaded files

Creating new files, folders or uploading files now have their sharing
icon updated accordingly.

For this, the global share status list that is cached in
OC.Share.statuses is reused for new files.

In OC.Share, split loadIcons into loadIcons + updateIcons.

Fixes #4977

Backport of 70c9652cdf6e00f1c62fb9a61d9dd4fb3e2c93c3
Added isPublic flag in files_sharing template

To make it possible for apps to find out whether they are running in
public mode, the flag "isPublic" will now be present in the DOM.

Backport of 6a36d7fa864ec241d05a00b419ca48cf84ca41ff required by other
fixes.
Disable versions app JS in public mode

Since the version JS code isn't used in public link mode, disable it to
prevent Chrome freezing bugs due to the t() call being synchronous.

Fixes #4545

Backport of 41c6c44221177da4458f982bb13a5c7a6f90ff8e
ocs share api backport to stable5
check if encryption app is enabled before trying to calculate file size
check if key exists before reading it
fix check if app is enabled

Conflicts:
	apps/files_encryption/lib/proxy.php
Use display name from magic cookie, fixes #4884
fix infinite loop while updating etags, fix for #4365
Merge pull request #5415 from owncloud/fix_4884

Use display name from magic cookie, fixes #4884