From 51ac4da63ec16f78f729c448a7c4479d0e47f7eb Mon Sep 17 00:00:00 2001 From: Matt Mullenweg Date: Tue, 18 Jan 2005 06:12:23 +0000 Subject: [PATCH] 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 --- wp-includes/class-IXR.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/wp-includes/class-IXR.php b/wp-includes/class-IXR.php index 387a34ec91..f7ce36fe7f 100644 --- a/wp-includes/class-IXR.php +++ b/wp-includes/class-IXR.php @@ -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; }