diff options
author | zotlabs <mike@macgirvin.com> | 2019-03-05 04:11:43 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2019-03-05 09:44:36 +0100 |
commit | d407e5556ef2ba5af620869d84394181f9628a57 (patch) | |
tree | 71e59f96ff627ad367aaf4cbbf7e985af4792a7d /Zotlabs/Lib/Api_router.php | |
parent | 6a3cfe54af7e72dec88f7a90a8700761c364990e (diff) | |
download | volse-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/Api_router.php')
-rw-r--r-- | Zotlabs/Lib/Api_router.php | 10 |
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; } |