aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Lib
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2019-03-05 04:11:43 +0000
committerMario <mario@mariovavti.com>2019-03-05 09:44:36 +0100
commitd407e5556ef2ba5af620869d84394181f9628a57 (patch)
tree71e59f96ff627ad367aaf4cbbf7e985af4792a7d /Zotlabs/Lib
parent6a3cfe54af7e72dec88f7a90a8700761c364990e (diff)
downloadvolse-hubzilla-d407e5556ef2ba5af620869d84394181f9628a57.tar.gz
volse-hubzilla-d407e5556ef2ba5af620869d84394181f9628a57.tar.bz2
volse-hubzilla-d407e5556ef2ba5af620869d84394181f9628a57.zip
api_router - allow parameters as final path argument
(cherry picked from commit 47001c33039e6915f12b95a3e948caae6cf21d41)
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;
}