From 01ee685d3cfbb1bcf8a5cea98a0e43d2d21eb519 Mon Sep 17 00:00:00 2001 From: saxmatt 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: http://svn.automattic.com/wordpress/trunk@2103 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- 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 387a34ec9..f7ce36fe7 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; }