summaryrefslogtreecommitdiff
path: root/inc/IXR_Library.php
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2009-12-11 13:55:37 +0100
committerAndreas Gohr <andi@splitbrain.org>2009-12-11 13:55:37 +0100
commit6fcceb42baae3bb0f1a8e8af799c62745cd9fdb0 (patch)
tree844e0131006758f55f6dcca81ec8c35c8c4f62ff /inc/IXR_Library.php
parent495ae559d1de8f85b05f4f0d95b34905eb80ae4a (diff)
downloadrpg-6fcceb42baae3bb0f1a8e8af799c62745cd9fdb0.tar.gz
rpg-6fcceb42baae3bb0f1a8e8af799c62745cd9fdb0.tar.bz2
fixed possible problem in XMLRPC when no arguments are passed
Ignore-this: e422f7ffed22302c153bba0d7227b6e0 darcs-hash:20091211125537-7ad00-365862547d10c83af000b4ef0fb3f0d632d7ffea.gz
Diffstat (limited to 'inc/IXR_Library.php')
-rw-r--r--inc/IXR_Library.php21
1 files changed, 12 insertions, 9 deletions
diff --git a/inc/IXR_Library.php b/inc/IXR_Library.php
index 2cfd4d1fe..088ae8d45 100644
--- a/inc/IXR_Library.php
+++ b/inc/IXR_Library.php
@@ -350,6 +350,9 @@ EOD;
# Adjusted for DokuWiki to use call_user_func_array
+ // args need to be an array
+ $args = (array) $args;
+
// Are we dealing with a function or a method?
if (substr($method, 0, 5) == 'this:') {
// It's a class method - check it exists
@@ -360,15 +363,15 @@ EOD;
// Call the method
#$result = $this->$method($args);
$result = call_user_func_array(array(&$this,$method),$args);
- } elseif (substr($method, 0, 7) == 'plugin:') {
- require_once(DOKU_INC.'inc/pluginutils.php');
- list($pluginname, $callback) = explode(':', substr($method, 7), 2);
- if(!plugin_isdisabled($pluginname)) {
- $plugin = plugin_load('action', $pluginname);
- return call_user_func_array(array($plugin, $callback), $args);
- } else {
- return new IXR_Error(-99999, 'server error');
- }
+ } elseif (substr($method, 0, 7) == 'plugin:') {
+ require_once(DOKU_INC.'inc/pluginutils.php');
+ list($pluginname, $callback) = explode(':', substr($method, 7), 2);
+ if(!plugin_isdisabled($pluginname)) {
+ $plugin = plugin_load('action', $pluginname);
+ return call_user_func_array(array($plugin, $callback), $args);
+ } else {
+ return new IXR_Error(-99999, 'server error');
+ }
} else {
// It's a function - does it exist?
if (!function_exists($method)) {