From 49cac615d7831ae2aea8ff02a366eab66e2d56d6 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Wed, 12 Jan 2022 13:32:48 +0200 Subject: [PATCH] fixing the fix ;) call_user_func_array(): Argument #1 ($callback) must be a valid callback, class admin_account does not have a method "ajax_process_content" --- api/src/Json/Request.php | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/api/src/Json/Request.php b/api/src/Json/Request.php index 851d118d99..04ffbad92b 100644 --- a/api/src/Json/Request.php +++ b/api/src/Json/Request.php @@ -126,13 +126,6 @@ class Request { list($appName) = explode('_',$className); } - - // Check for a real static method, avoid instantiation if it is - $m = new ReflectionMethod($className.'::'.$functionName); - if($m->isStatic()) - { - $ajaxClass = $className; - } } else { @@ -169,6 +162,16 @@ class Request break; } + // Check for a real static method, avoid instantiation if it is + if (strpos($menuaction,'::') !== false && strpos($menuaction,'.') === false) + { + $m = new ReflectionMethod($menuaction); + if($m->isStatic()) + { + $ajaxClass = $className; + } + } + if(substr($className,0,4) != 'ajax' && substr($className,-4) != 'ajax' && $menuaction != 'etemplate.etemplate.process_exec' && substr($functionName,0,4) != 'ajax' || !preg_match('/^[A-Za-z0-9_\\\\-]+(\.[A-Za-z0-9_\\\\]+\.|::)[A-Za-z0-9_]+$/',$menuaction)) @@ -184,7 +187,7 @@ class Request { $ajaxClass = $GLOBALS['egw']->framework; } - else if (!$ajaxClass) + elseif (!isset($ajaxClass)) { $ajaxClass = class_exists($className) ? new $className() : CreateObject($appName.'.'.$className); }