summaryrefslogtreecommitdiffstats
path: root/lib/private/appframework
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2014-07-14 17:10:07 +0200
committerMorris Jobke <hey@morrisjobke.de>2014-07-14 17:10:07 +0200
commit9ee1c7ff7143c9d75a5f5a9f9477cc73f5d97717 (patch)
tree18d03c605d51cc54422a8a3f9763fd3c08e8b682 /lib/private/appframework
parent4b917418751a56a369580d1981933e25edbe205b (diff)
parent2662c4c61b5f8dcb274a1a205de1c2b0d8980b1c (diff)
downloadnextcloud-server-9ee1c7ff7143c9d75a5f5a9f9477cc73f5d97717.tar.gz
nextcloud-server-9ee1c7ff7143c9d75a5f5a9f9477cc73f5d97717.zip
Merge pull request #9228 from owncloud/remove-routing-singular-issues
Routing: Dont strip the s from the resource id to prevent possible weird behavior with irregular english plural nouns
Diffstat (limited to 'lib/private/appframework')
-rw-r--r--lib/private/appframework/routing/routeconfig.php14
1 files changed, 2 insertions, 12 deletions
diff --git a/lib/private/appframework/routing/routeconfig.php b/lib/private/appframework/routing/routeconfig.php
index 91ea7778d08..5b4d411a355 100644
--- a/lib/private/appframework/routing/routeconfig.php
+++ b/lib/private/appframework/routing/routeconfig.php
@@ -88,7 +88,7 @@ class RouteConfig {
->method($verb)
->action($handler);
- // optionally register requirements for route. This is used to
+ // optionally register requirements for route. This is used to
// tell the route parser how url parameters should be matched
if(array_key_exists('requirements', $simpleRoute)) {
$router->requirements($simpleRoute['requirements']);
@@ -122,14 +122,13 @@ class RouteConfig {
foreach ($resources as $resource => $config) {
// the url parameter used as id to the resource
- $resourceId = $this->buildResourceId($resource);
foreach($actions as $action) {
$url = $config['url'];
$method = $action['name'];
$verb = isset($action['verb']) ? strtoupper($action['verb']) : 'GET';
$collectionAction = isset($action['on-collection']) ? $action['on-collection'] : false;
if (!$collectionAction) {
- $url = $url . '/' . $resourceId;
+ $url = $url . '/{id}';
}
if (isset($action['url-postfix'])) {
$url = $url . '/' . $action['url-postfix'];
@@ -169,15 +168,6 @@ class RouteConfig {
}
/**
- * Generates the id used in the url part o the route url
- * @param string $resource
- * @return string
- */
- private function buildResourceId($resource) {
- return '{'.$this->underScoreToCamelCase(rtrim($resource, 's')).'Id}';
- }
-
- /**
* Underscored strings are converted to camel case strings
* @param string $str
* @return string