nextcloud/apps/files_sharing/tests
Lukas Reschke e2453d78c0 Properly catch whether a share is null
Despite it's PHPDoc the function might return `null` which was not properly catched and thus in some situations the share was resolved to the sharing users root directory.

To test this perform the following steps:

* Share file in owncloud 7 (7.0.4.2)
* Delete the parent folder of the shared file
* The share stays is in the DB and the share via the sharelink is inaccessible. (which is good)
* Upgrade to owncloud 8 (8.0.2) (This step is crucial. The bug is not reproduceable without upgrading from 7 to 8. It seems like the old tokens are handled different than the newer ones)
* Optional Step: Logout, Reset Browser Session, etc.
* Access the share via the old share url: almost empty page, but there is a dowload button which adds a "/download" to the URL.
* Upon clicking, a download.zip is downloaded which contains EVERYTHING from the owncloud directory (of the user who shared the file)
* No exception is thrown and no error is logged.

This will add a check whether the share is a valid one and also adds unit tests to prevent further regressions in the future. Needs to be backported to ownCloud 8.

Adding a proper clean-up of the orphaned shares is out-of-scope and would probably require some kind of FK or so.

Fixes https://github.com/owncloud/core/issues/15097
2015-03-24 11:21:58 +01:00
..
controller Properly catch whether a share is null 2015-03-24 11:21:58 +01:00
external Do not make setupMounts() public just because of testing 2015-03-11 11:10:43 +01:00
js Merge pull request #13679 from owncloud/public-disablesharejsplugin 2015-01-27 09:33:38 +01:00
middleware Revert "Updating license headers" 2015-02-26 11:37:37 +01:00
activity.php Revert "Updating license headers" 2015-02-26 11:37:37 +01:00
api.php Added unit test 2015-03-19 10:47:09 +01:00
backend.php Revert "Updating license headers" 2015-02-26 11:37:37 +01:00
cache.php Revert "Updating license headers" 2015-02-26 11:37:37 +01:00
externalstorage.php Revert "Updating license headers" 2015-02-26 11:37:37 +01:00
helper.php Revert "Updating license headers" 2015-02-26 11:37:37 +01:00
migrationtest.php Revert "Updating license headers" 2015-02-26 11:37:37 +01:00
permissions.php Revert "Updating license headers" 2015-02-26 11:37:37 +01:00
propagation.php Add unit test for size propagation across share boundaries 2015-03-09 12:56:22 +01:00
proxy.php Revert "Updating license headers" 2015-02-26 11:37:37 +01:00
server2server.php Revert "Updating license headers" 2015-02-26 11:37:37 +01:00
share.php Revert "Updating license headers" 2015-02-26 11:37:37 +01:00
sharedmount.php Revert "Updating license headers" 2015-02-26 11:37:37 +01:00
sharedstorage.php Do not automatically add "update" permission to shared mounts 2015-03-20 12:33:59 +01:00
testcase.php Revert "Updating license headers" 2015-02-26 11:37:37 +01:00
updater.php Revert "Updating license headers" 2015-02-26 11:37:37 +01:00
watcher.php Revert "Updating license headers" 2015-02-26 11:37:37 +01:00