aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Lib
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2019-03-04 20:11:43 -0800
committerzotlabs <mike@macgirvin.com>2019-03-04 20:11:43 -0800
commit47001c33039e6915f12b95a3e948caae6cf21d41 (patch)
tree44c905caea3cb9f2e7f5454e4ff5b189a79b0b4c /Zotlabs/Lib
parent8e50fecccca5dd72a49869502e541db03632cd86 (diff)
downloadvolse-hubzilla-47001c33039e6915f12b95a3e948caae6cf21d41.tar.gz
volse-hubzilla-47001c33039e6915f12b95a3e948caae6cf21d41.tar.bz2
volse-hubzilla-47001c33039e6915f12b95a3e948caae6cf21d41.zip
api_router - allow parameters as final path argument
Diffstat (limited to 'Zotlabs/Lib')
-rw-r--r--Zotlabs/Lib/Api_router.php10
1 files changed, 9 insertions, 1 deletions
diff --git a/Zotlabs/Lib/Api_router.php b/Zotlabs/Lib/Api_router.php
index 404678bd9..6e3f231a9 100644
--- a/Zotlabs/Lib/Api_router.php
+++ b/Zotlabs/Lib/Api_router.php
@@ -12,8 +12,16 @@ class Api_router {
}
static function find($path) {
- if(array_key_exists($path,self::$routes))
+ if (array_key_exists($path,self::$routes)) {
return self::$routes[$path];
+ }
+
+ $with_params = dirname($path) . '/[id]';
+
+ if (array_key_exists($with_params,self::$routes)) {
+ return self::$routes[$with_params];
+ }
+
return null;
}