summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimObert <tobert@w-commerce.de>2020-02-14 14:12:01 +0100
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>2020-02-23 15:45:51 +0000
commit2f635334e693267b99f88db5904dd243c9b94082 (patch)
tree594c61679f465d9c4801815ef28dc83115a2aa50
parent27a25f974b0a4d14716a932d091bd41d43d0ff0f (diff)
downloadnextcloud-server-2f635334e693267b99f88db5904dd243c9b94082.tar.gz
nextcloud-server-2f635334e693267b99f88db5904dd243c9b94082.zip
Fix requested changes
Signed-off-by: Tim Obert <tobert@w-commerce.de>
-rw-r--r--core/routes.php8
-rw-r--r--lib/public/AppFramework/AuthPublicShareController.php15
2 files changed, 9 insertions, 14 deletions
diff --git a/core/routes.php b/core/routes.php
index f802b644485..829fa8576c8 100644
--- a/core/routes.php
+++ b/core/routes.php
@@ -86,10 +86,10 @@ $application->registerRoutes($this, [
// Legacy routes that need to be globally available while they are handled by an app
['name' => 'viewcontroller#showFile', 'url' => '/f/{fileid}', 'verb' => 'GET', 'app' => 'files'],
- ['name' => 'share#showShare', 'url' => '/s/{token}', 'verb' => 'GET', 'app' => 'files_sharing'],
- ['name' => 'share#showAuthenticate', 'url' => '/s/{token}/authenticate/{redirect}', 'verb' => 'GET', 'app' => 'files_sharing'],
- ['name' => 'share#authenticate', 'url' => '/s/{token}/authenticate/{redirect}', 'verb' => 'POST', 'app' => 'files_sharing'],
- ['name' => 'share#downloadShare', 'url' => '/s/{token}/download', 'verb' => 'GET', 'app' => 'files_sharing'],
+ ['name' => 'sharecontroller#showShare', 'url' => '/s/{token}', 'verb' => 'GET', 'app' => 'files_sharing'],
+ ['name' => 'sharecontroller#showAuthenticate', 'url' => '/s/{token}/authenticate/{redirect}', 'verb' => 'GET', 'app' => 'files_sharing'],
+ ['name' => 'sharecontroller#authenticate', 'url' => '/s/{token}/authenticate/{redirect}', 'verb' => 'POST', 'app' => 'files_sharing'],
+ ['name' => 'sharecontroller#downloadShare', 'url' => '/s/{token}/download', 'verb' => 'GET', 'app' => 'files_sharing'],
['name' => 'publicpreview#directLink', 'url' => '/s/{token}/preview', 'verb' => 'GET', 'app' => 'files_sharing'],
['name' => 'requesthandlercontroller#addShare', 'url' => '/ocm/shares', 'verb' => 'POST', 'app' => 'cloud_federation_api'],
['name' => 'requesthandlercontroller#receiveNotification', 'url' => '/ocm/notifications', 'verb' => 'POST', 'app' => 'cloud_federation_api'],
diff --git a/lib/public/AppFramework/AuthPublicShareController.php b/lib/public/AppFramework/AuthPublicShareController.php
index 8bc2da301c2..0ccac7cbe63 100644
--- a/lib/public/AppFramework/AuthPublicShareController.php
+++ b/lib/public/AppFramework/AuthPublicShareController.php
@@ -156,15 +156,6 @@ abstract class AuthPublicShareController extends PublicShareController {
);
}
- /**
- * @param $string
- * @return string
- */
- private function camelCaseToLowerCaseUnderscored($string)
- {
- $value = preg_replace('/(?<=\\w)([A-Z])/', '_\\1', $string);
- return mb_strtolower($value, 'utf-8');
- }
/**
* @since 14.0.0
@@ -172,7 +163,11 @@ abstract class AuthPublicShareController extends PublicShareController {
private function getRoute(string $function): string {
$app = strtolower($this->appName);
$class = (new \ReflectionClass($this))->getShortName();
- // $class = $this->camelCaseToLowerCaseUnderscored(substr($class, 0, strpos($class, 'Controller')));
+ if ($this->appName === 'files_sharing') {
+ $class = strtolower($class);
+ } else if (substr($class, -10) === 'Controller') {
+ $class = substr($class, 0, -10);
+ }
return $app .'.'. $class .'.'. $function;
}