http://mosquito.wordpress.org/view.php?id=708 - Patch from Owen Winkler allowing XML-RPC library to call classes without extending the base class.

git-svn-id: https://develop.svn.wordpress.org/trunk@2103 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Matt Mullenweg 2005-01-18 06:12:23 +00:00
parent 875b900fcf
commit 51ac4da63e

View File

@ -2,7 +2,8 @@
/*
IXR - The Inutio XML-RPC Library - (c) Incutio Ltd 2002
Version 1.61 - Simon Willison, 11th July 2003 (htmlentities -> htmlspecialchars)
Version 1.62WP - Simon Willison, 11th July 2003 (htmlentities -> htmlspecialchars)
^^^^^^ (We've made some changes)
Site: http://scripts.incutio.com/xmlrpc/
Manual: http://scripts.incutio.com/xmlrpc/manual.php
Made available under the BSD License: http://www.opensource.org/licenses/bsd-license.php
@ -344,11 +345,15 @@ EOD;
$result = $this->$method($args);
} else {
// It's a function - does it exist?
if (!function_exists($method)) {
if (is_array($method)) {
if (!method_exists($method[0], $method[1])) {
return new IXR_Error(-32601, 'server error. requested object method "'.$method[1].'" does not exist.');
}
} else if (!function_exists($method)) {
return new IXR_Error(-32601, 'server error. requested function "'.$method.'" does not exist.');
}
// Call the function
$result = $method($args);
$result = call_user_func($method, $args);
}
return $result;
}