summaryrefslogtreecommitdiffstats
path: root/remote.php
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2016-04-05 09:59:43 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2016-04-05 09:59:43 +0200
commit7bdde98617ad3c7f56dced1add0a155f4a0e5a2e (patch)
tree2d1d8f1a95fe0e782208b1f3366b9abe1bd17a2a /remote.php
parent961bb4c3e3cb944cb61c7331399a1d2bc9e51f6d (diff)
downloadnextcloud-server-7bdde98617ad3c7f56dced1add0a155f4a0e5a2e.tar.gz
nextcloud-server-7bdde98617ad3c7f56dced1add0a155f4a0e5a2e.zip
All webdav endpoints within remote.php are now hardcoded - helps to prevent migration issues like #23610 - furthermore there is no need to dynamically lookup all the endpoints we already know
Diffstat (limited to 'remote.php')
-rw-r--r--remote.php23
1 files changed, 22 insertions, 1 deletions
diff --git a/remote.php b/remote.php
index df229eb675a..86b47629d73 100644
--- a/remote.php
+++ b/remote.php
@@ -84,6 +84,27 @@ function handleException(Exception $e) {
}
}
+/**
+ * @param $service
+ * @return string
+ */
+function resolveService($service) {
+ $services = [
+ 'webdav' => 'dav/appinfo/v1/webdav.php',
+ 'dav' => 'dav/appinfo/v2/remote.php',
+ 'caldav' => 'dav/appinfo/v1/caldav.php',
+ 'calendar' => 'dav/appinfo/v1/caldav.php',
+ 'carddav' => 'dav/appinfo/v1/carddav.php',
+ 'contacts' => 'dav/appinfo/v1/carddav.php',
+ 'files' => 'dav/appinfo/v1/webdav.php',
+ ];
+ if (isset($services[$service])) {
+ return $services[$service];
+ }
+
+ return \OC::$server->getConfig()->getAppValue('core', 'remote_' . $service);
+}
+
try {
require_once 'lib/base.php';
@@ -103,7 +124,7 @@ try {
}
$service=substr($pathInfo, 1, $pos-1);
- $file = \OC::$server->getConfig()->getAppValue('core', 'remote_' . $service);
+ $file = resolveService($service);
if(is_null($file)) {
throw new RemoteException('Path not found', OC_Response::STATUS_NOT_FOUND);