nextcloud/lib/private
Lukas Reschke 13e817e901 Throw exception on `getPath` if file does not exist
Currently the `getPath` methods returned `NULL` in case when a file with the specified ID does not exist. This however mandates that developers are checking for the `NULL` case and if they do not the door for bugs with all kind of impact is widely opened.

This is especially harmful if used in context with Views where the final result is limited based on the result of `getPath`, if `getPath` returns `NULL` PHP type juggles this to an empty string resulting in all possible kind of bugs.

While one could argue that this is a misusage of the API the fact is that it is very often misused and an exception will trigger an immediate stop of execution as well as log this behaviour and show a pretty error page.

I also adjusted some usages where I believe that we need to catch these errors, in most cases this is though simply an error that should hard-fail.
2015-10-25 17:58:21 +01:00
..
activity update licence headers via script 2015-10-05 21:15:52 +02:00
app Merge pull request #19731 from owncloud/update-list-of-deprecated-methods 2015-10-14 16:34:55 +02:00
appframework Remove dependency on ICrypto + use XOR 2015-10-21 17:33:41 +02:00
archive Update license headers 2015-03-26 11:44:36 +01:00
backgroundjob deduplicate @xenopathic 2015-10-06 09:52:19 +02:00
cache update licence headers via script 2015-10-05 21:15:52 +02:00
command Merge pull request #15129 from owncloud/version-command-bus 2015-03-26 19:55:13 +01:00
console adding occ upgrade text note 2015-10-14 12:16:17 +02:00
contacts Update license headers 2015-03-26 11:44:36 +01:00
db update licence headers via script 2015-10-05 21:15:52 +02:00
diagnostics Update license headers 2015-03-26 11:44:36 +01:00
encryption update licence headers via script 2015-10-05 21:15:52 +02:00
files Throw exception on `getPath` if file does not exist 2015-10-25 17:58:21 +01:00
group New \OC\SubAdmin class 2015-10-21 11:32:38 +02:00
hooks update license headers and authors 2015-06-25 14:13:49 +02:00
http/client update licence headers via script 2015-10-05 21:15:52 +02:00
l10n update licence headers via script 2015-10-05 21:15:52 +02:00
legacy Legacy OC_SubAdmin is now just a wrapper 2015-10-21 11:32:38 +02:00
lock add phpdoc 2015-10-21 09:43:30 +02:00
log Expose syslog tag in the configuration 2015-10-22 17:42:55 +02:00
mail Setup sendmail transport 2015-10-08 16:48:18 +02:00
memcache deduplicate @xenopathic 2015-10-06 09:52:19 +02:00
notification Allow checking whether there are notifiers registered 2015-09-17 11:08:17 +02:00
ocs Merge pull request #18184 from owncloud/ocs-merge-headers 2015-10-21 10:36:37 +02:00
preview deduplicate @xenopathic 2015-10-06 09:52:19 +02:00
route deduplicate @xenopathic 2015-10-06 09:52:19 +02:00
search Scrutinizer Auto-Fixes 2015-05-19 11:23:06 +00:00
security update licence headers via script 2015-10-05 21:15:52 +02:00
session Delete cookie instead of emptying value 2015-10-19 19:54:12 +02:00
setup [OCI setup] remove static logger/config calls 2015-10-20 08:53:57 +02:00
share detect object homestorage in share code 2015-10-16 21:41:51 +02:00
tagging Update license headers 2015-03-26 11:44:36 +01:00
template update license headers and authors 2015-06-25 14:13:49 +02:00
user Make sure that remote shares use the correct uid casing 2015-10-06 15:16:19 +02:00
activitymanager.php update licence headers via script 2015-10-05 21:15:52 +02:00
allconfig.php Move the filtering of sensitive data to the config class 2015-09-25 11:08:33 +02:00
api.php Merge pull request #18184 from owncloud/ocs-merge-headers 2015-10-21 10:36:37 +02:00
app.php deduplicate @xenopathic 2015-10-06 09:52:19 +02:00
appconfig.php update licence headers via script 2015-10-05 21:15:52 +02:00
apphelper.php update license headers and authors 2015-06-25 14:13:49 +02:00
archive.php Update license headers 2015-03-26 11:44:36 +01:00
avatar.php update license headers and authors 2015-06-25 14:13:49 +02:00
avatarmanager.php update license headers and authors 2015-06-25 14:13:49 +02:00
capabilitiesmanager.php Use DI 2015-08-10 10:45:16 +02:00
config.php Remove DEBUG constant and use config value 2015-08-24 15:14:05 +02:00
contactsmanager.php Update license headers 2015-03-26 11:44:36 +01:00
databaseexception.php Update license headers 2015-03-26 11:44:36 +01:00
databasesetupexception.php Update license headers 2015-03-26 11:44:36 +01:00
datetimeformatter.php Update license headers 2015-03-26 11:44:36 +01:00
datetimezone.php When guessing the timezone, the offset might only be valid on a given timestamp 2015-04-07 10:13:06 +02:00
db.php Remove remainings of mssql 2015-07-29 18:19:31 +02:00
defaults.php Revert "make knowledge base url configurable" 2015-08-11 14:20:25 +02:00
eventsource.php update licence headers via script 2015-10-05 21:15:52 +02:00
filechunking.php work directly on storages when doing a chunked upload assembly 2015-09-14 20:35:33 +02:00
files.php The full name has to be tested if it's a dir - fixes #19854 2015-10-19 10:07:33 +02:00
forbiddenexception.php Update license headers 2015-03-26 11:44:36 +01:00
group.php Add remark that $run is not supported anymore 2015-10-02 23:19:26 +02:00
helper.php update licence headers via script 2015-10-05 21:15:52 +02:00
hintexception.php Update license headers 2015-03-26 11:44:36 +01:00
hook.php Throw exception on `getPath` if file does not exist 2015-10-25 17:58:21 +01:00
httphelper.php Add connection timeout to default POST options 2015-05-26 11:22:50 +02:00
image.php Make sure we have a resource before measuring its size 2015-06-08 15:10:29 +02:00
installer.php an-app-is-identified-by-having-a-info.xml-app.php-should-not-be-mandatory 2015-10-16 17:25:22 +02:00
json.php Encode HTML tags in JSON 2015-09-03 00:44:46 +02:00
l10n.php update licence headers via script 2015-10-05 21:15:52 +02:00
largefilehelper.php Update license headers 2015-03-26 11:44:36 +01:00
log.php update licence headers via script 2015-10-05 21:15:52 +02:00
naturalsort.php update licence headers via script 2015-10-05 21:15:52 +02:00
naturalsort_defaultcollator.php Update license headers 2015-03-26 11:44:36 +01:00
navigationmanager.php Update license headers 2015-03-26 11:44:36 +01:00
needsupdateexception.php Update license headers 2015-03-26 11:44:36 +01:00
notsquareexception.php Update license headers 2015-03-26 11:44:36 +01:00
ocs.php update licence headers via script 2015-10-05 21:15:52 +02:00
ocsclient.php Disable app store for EE by default 2015-10-08 14:52:52 +02:00
preview.php Add tests 2015-10-01 13:17:22 +02:00
previewmanager.php update license headers and authors 2015-06-25 14:13:49 +02:00
repair.php Repair step to remove bogus expiration dates from non-link shares 2015-10-01 08:27:12 +02:00
repairexception.php Update license headers 2015-03-26 11:44:36 +01:00
repairstep.php update license headers and authors 2015-06-25 14:13:49 +02:00
response.php Add blob: scheme to default CSP policy 2015-09-29 14:27:35 +02:00
search.php Update license headers 2015-03-26 11:44:36 +01:00
server.php Remove dependency on ICrypto + use XOR 2015-10-21 17:33:41 +02:00
servernotavailableexception.php update license headers and authors 2015-06-25 14:13:49 +02:00
serviceunavailableexception.php Update license headers 2015-03-26 11:44:36 +01:00
setup.php Check for PDO instead of removed function for PHP 7 compatibility 2015-07-30 12:32:22 +02:00
streamer.php Only use zip64 when we have 64 bit php 2015-10-08 09:13:08 +02:00
subadmin.php New \OC\SubAdmin class 2015-10-21 11:32:38 +02:00
systemconfig.php Deduplicate constant 2015-09-25 13:17:23 +02:00
tagmanager.php Update license headers 2015-03-26 11:44:36 +01:00
tags.php Fix undefined variable $tagId 2015-05-04 16:19:26 +02:00
template.php Merge pull request #19537 from owncloud/fix-white-page-of-death 2015-10-07 14:55:11 +02:00
templatelayout.php Always pass in ILogger 2015-10-09 14:08:22 +02:00
tempmanager.php deduplicate @xenopathic 2015-10-06 09:52:19 +02:00
updater.php Merge pull request #19918 from owncloud/send-begin-message 2015-10-21 14:52:19 +02:00
urlgenerator.php Fix UrlGenerator::imagePath() for app paths 2015-04-03 23:42:18 +01:00
user.php Add remark that $run is not supported anymore 2015-10-02 23:19:26 +02:00
util.php Remove dependency on ICrypto + use XOR 2015-10-21 17:33:41 +02:00