summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2016-07-27 15:28:35 +0200
committerRoeland Jago Douma <roeland@famdouma.nl>2016-07-27 15:28:35 +0200
commit8bdd0adceecfa7382140022819546acae61ed0a5 (patch)
treeff968085de18a5b43a493c656720314e68657b8c /lib
parent10726dd00df37be77c3088302e16e64b09a6d25f (diff)
downloadnextcloud-server-8bdd0adceecfa7382140022819546acae61ed0a5.tar.gz
nextcloud-server-8bdd0adceecfa7382140022819546acae61ed0a5.zip
Support subdir in the OCS v2 endpoint
We should check against the ending substring since people could run their nextcloud in a subfolder. * Added test
Diffstat (limited to 'lib')
-rw-r--r--lib/private/AppFramework/Middleware/OCSMiddleware.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/private/AppFramework/Middleware/OCSMiddleware.php b/lib/private/AppFramework/Middleware/OCSMiddleware.php
index 0d97aa6ed94..e07d100d8ac 100644
--- a/lib/private/AppFramework/Middleware/OCSMiddleware.php
+++ b/lib/private/AppFramework/Middleware/OCSMiddleware.php
@@ -58,7 +58,7 @@ class OCSMiddleware extends Middleware {
}
$response = new OCSResponse($format, $code, $exception->getMessage());
- if ($this->request->getScriptName() === '/ocs/v2.php') {
+ if (substr_compare($this->request->getScriptName(), '/ocs/v2.php', -strlen('/ocs/v2.php')) === 0) {
$response->setStatus($code);
}
return $response;