From b26a847bbee678770fb40773141ce9d6d151dc9e Mon Sep 17 00:00:00 2001 From: donal72 Date: Thu, 2 Aug 2007 00:19:43 +0000 Subject: [PATCH] Minor mnet bugfixing. --- mnet/xmlrpc/server.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/mnet/xmlrpc/server.php b/mnet/xmlrpc/server.php index 630ec789f9..defca4eaae 100644 --- a/mnet/xmlrpc/server.php +++ b/mnet/xmlrpc/server.php @@ -356,7 +356,7 @@ function mnet_server_dispatch($payload) { // xmlrpc_decode_request($xml, &$method) $params = xmlrpc_decode_request($payload, $method); - // $method is something like: "mod/forum/lib/forum_add_instance" + // $method is something like: "mod/forum/lib.php/forum_add_instance" // $params is an array of parameters. A parameter might itself be an array. // Whitelist characters that are permitted in a method name @@ -366,8 +366,12 @@ function mnet_server_dispatch($payload) { exit(mnet_server_fault(713, 'nosuchfunction')); } - $callstack = explode('/', $method); - // callstack will look like array('mod', 'forum', 'lib', 'forum_add_instance'); + if(preg_match("/^system./", $method)) { + $callstack = explode('.', $method); + } else { + $callstack = explode('/', $method); + // callstack will look like array('mod', 'forum', 'lib.php', 'forum_add_instance'); + } /** * What has the site administrator chosen as his dispatcher setting? @@ -485,7 +489,7 @@ function mnet_server_dispatch($payload) { // The call stack holds the path to any include file $includefile = $CFG->dirroot.'/'.implode('/',$callstack).'/'.$filename.'.php'; - $response = mnet_server_invoke_function($includefile, $functionname, $method, $payload); + $response = mnet_server_invoke_method($includefile, $functionname, $method, $payload); echo $response; } -- 2.39.5