WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#9516 closed defect (bug) (fixed)

incorrect path in wp.getUsersBlogs used in xmlrpc

Reported by: MidnighToker Owned by: josephscott
Milestone: 2.7.2 Priority: high
Severity: normal Version: 2.7.1
Component: XML-RPC Keywords: has-patch
Focuses: Cc:

Description

I believe I have found a bug, whereby the string xmlrpc_url returned by wp.getUsersBlogs is incorrect.

I have wordpress 2.7.1 installed to http://myurl.com/wordpress/

I have moved the index.php file into myurl.com/ and changed the appropriate settings as documented here (http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory).

In General Settings, Wordpress Address (URL) is set to "http://myurl.com/wordpress/", Blog URL is set to "http://myurl.com/".

So far, everything seems to be set up OK.
If I visit http://myurl.com/wordpress/xmlrpc.php?rsd it reports the paths to the xmlrpc.php file correctly, as it does for the link in my index.php (<link rel="pingback" href="http://my.com/wordpress/xmlrpc.php" />)

When I try to connect to my blog from this new client I'm using (wpToGo on Android), its failing to connect.

After some major debugging with the developer, it seems that the app is at first making a correct connection to /wordpress/xmlrpc.php and getting data back, but is then trying to access /xmlrpc.php (which obviously doesn't exist).

After packet sniffing the connection, it seems that wp.getUserBlogs is returning the wrong path for the xmlrpc.php file:


POST /wordpress/xmlrpc.php HTTP/1.1

Content-Type: text/xml

Content-Length: 217

Host: cranialtrauma.co.uk

Connection: Keep-Alive

User-Agent: Apache-HttpClient/UNAVAILABLE (java 1.4)

<?xml version='1.0' ?><methodCall><methodName>wp.getUsersBlogs</methodName><params><param><value><string>thisismyusername</string></value></param><param><value><string>thisismypassword</string></value></param></params></methodCall>HTTP/1.1 200 OK

Date: Sat, 11 Apr 2009 21:20:12 GMT

Server: Apache

Connection: close

Content-Length: 645

Content-Type: text/xml

<?xml version="1.0"?>
<methodResponse>

<params>

<param>

<value>

<array><data>

<value><struct>
<member><name>isAdmin</name><value><boolean>1</boolean></value></member>
<member><name>url</name><value><string>http://my.com/</string></value></member>
<member><name>blogid</name><value><string>1</string></value></member>
<member><name>blogName</name><value><string>MyBlog</string></value></member>
<member><name>xmlrpc</name><value><string>http://my.com/xmlrpc.php</string></value></member>

</struct></value>
</data></array>

</value>

</param>

</params>

</methodResponse>


If I change line 1596 of xmlrpc.php, replacing 'home' with 'siteurl' it all seems to work fine -though I don't know how much damage this bodge will cause.

'xmlrpc' => get_option('siteurl') . '/xmlrpc.php', //s/home/siteurl

Your time is appreciated.

Fligg.

Attachments (2)

9516.diff (420 bytes) - added by ryan 5 years ago.
xmlrpc.php.diff (684 bytes) - added by josephscott 5 years ago.

Download all attachments as: .zip

Change History (6)

comment:1 DD325 years ago

  • Keywords has-patch added
  • Milestone changed from Unassigned to 2.7.2

Due to it only being a 1-line change, marking as has-patch

That change seems like it would be the correct way to go.

ryan5 years ago

josephscott5 years ago

comment:2 josephscott5 years ago

Updated patch that fixes this for both wp.getUsersBlogs and blogger.getUsersBlogs, which made it work under the conditions I was testing.

comment:3 ryan5 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [10932]) Fix path to xmlrpc. Props MidnighToker. fixes #9516

comment:4 ryan5 years ago

(In [10933]) Fix path to xmlrpc. Props MidnighToker. fixes #9516

Note: See TracTickets for help on using tickets.