diff --git a/classes/controller/Controller.php b/classes/controller/Controller.php index 7e4ebf6ed..0d4591455 100644 --- a/classes/controller/Controller.php +++ b/classes/controller/Controller.php @@ -175,8 +175,8 @@ abstract class ControllerCore // then using displayAjax[action] if ($this->ajax) { - $action = Tools::getValue('action'); - if (!empty($action) && method_exists($this, 'displayAjax'.Tools::toCamelCase($action, true))) + $action = Tools::toCamelCase(Tools::getValue('action', true)); + if (!empty($action) && method_exists($this, $action)) $this->{'displayAjax'.$action}(); elseif (method_exists($this, 'displayAjax')) $this->displayAjax(); diff --git a/tools/profiling/Controller.php b/tools/profiling/Controller.php index 1b55dd0dd..923faccec 100644 --- a/tools/profiling/Controller.php +++ b/tools/profiling/Controller.php @@ -227,8 +227,8 @@ abstract class Controller extends ControllerCore // then using displayAjax[action] if ($this->ajax) { - $action = Tools::getValue('action'); - if (!empty($action) && method_exists($this, 'displayAjax'.Tools::toCamelCase($action))) + $action = 'displayAjax'.Tools::toCamelCase(Tools::getValue('action', true)); + if (!empty($action) && method_exists($this, $action)) $this->{'displayAjax'.$action}(); elseif (method_exists($this, 'displayAjax')) $this->displayAjax();