From 1a282d1184643b90838177933ce018cd931d3571 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Tue, 28 May 2024 15:09:37 +0200 Subject: [PATCH] mvc:Dispatcher - add missing getActionName for backwards compatibility with Phalcon. closes https://github.com/opnsense/core/issues/7490 --- .../mvc/app/library/OPNsense/Mvc/Dispatcher.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/opnsense/mvc/app/library/OPNsense/Mvc/Dispatcher.php b/src/opnsense/mvc/app/library/OPNsense/Mvc/Dispatcher.php index 34591ad76..cd9d5e71a 100644 --- a/src/opnsense/mvc/app/library/OPNsense/Mvc/Dispatcher.php +++ b/src/opnsense/mvc/app/library/OPNsense/Mvc/Dispatcher.php @@ -59,6 +59,16 @@ class Dispatcher $this->parameters = $parameters; } + /** + * XXX: rename to getMethodName when phalcon is removed and return plain $this->action, + * next cleanup ApiControllerBase. + * @return string action name + */ + public function getActionName() + { + return substr($this->action,0, strlen($this->action)-6); + } + /** * Resolve controller class and inspect method to call, except when the target controller offers a __call * hook in which case we expect the target to offer proper error handling