﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	severity	resolution	keywords	cc	focuses
27141	XML-RPC API does not accept login parameters(solved)	lucasdaddiego		"Hi, i was trying to use the XML-RPC api, but I couldn't make it work.

I'm using a xml-rpc client for Chrome, (but i think that this happens with any client, because it's a php thing). The method i was trying was wp.getPosts(but it's general for all the methods). I passed the blog_id, the username, and the password, but the response was always a message with ""Invalid username or password"", but the username and password combination was right.

I enabled the debug logging, and in the log (wp-content/debug.log) appeared the following text:


{{{
PHP Notice:  Undefined offset: 0 in /opt/lampp/htdocs/test1/wp-includes/class-wp-xmlrpc-server.php on line 1443
PHP Notice:  Undefined offset: 1 in /opt/lampp/htdocs/test1/wp-includes/class-wp-xmlrpc-server.php on line 1444
PHP Notice:  Undefined offset: 2 in /opt/lampp/htdocs/test1/wp-includes/class-wp-xmlrpc-server.php on line 1445
}}}


Then I discovered that in the methods(for example, in line 1444) of the file /wp-includes/class-wp-xmlrpc-server.php the args are read in the following way:


{{{
$this->escape( $args );
$username = $args[0];
$password = $args[1];
}}}


But, that doesn't work. 
Then, I tried changing the code like this:


{{{
$username   = $args['username'];
$password   = $args['password'];
}}}


And it worked!

I'm running wordpress in a dev environment, with latest XAMPP, PHP 5.5.6,
and Kubuntu 13.10 x64.

I hope i'm not breaking any rule, and this might be helpful.
"	defect (bug)	closed	normal		XML-RPC		normal	invalid			
