Make WordPress Core

Opened 13 years ago

Last modified 13 years ago

#16565 closed defect (bug)

Several E_NOTICE when using IXR_Client — at Version 5

Reported by: tillkruess's profile tillkruess Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.0.5
Component: General Keywords:
Focuses: Cc:

Description (last modified by nacin)

POST /xmlrpc.php HTTP/1.0
Host: foobar.com
Content-Type: text/xml
User-Agent: The Incutio XML-RPC PHP Library -- WordPress/3.0.5
Content-Length: 281

<?xml version="1.0"?>
<methodCall>
<methodName>pingback.ping</methodName>
<params>
<param><value><string>http://foo.com/</string></value></param>
<param><value><string>http://bar.com/</string></value></param>
</params></methodCall>
HTTP/1.1 200 OK
Date: Tue, 15 Feb 2011 07:28:38 GMT
Server: Apache/2.2.16
X-Powered-By: PHP/5.3.5
Connection: close
Content-Type: text/html

<br />
<b>Notice</b>:  Undefined index: path in <b>/wp-includes/rewrite.php</b> on line <b>302</b><br />
<br />
<b>Notice</b>:  Trying to get property of non-object in <b>/wp-includes/rewrite.php</b> on line <b>341</b><br />
<br />
<b>Notice</b>:  Undefined index: HTTP_REFERER in <b>/wp-content/plugins/akismet/akismet.php</b> on line <b>300</b><br />
<br />
<b>Notice</b>:  Undefined index: user_ID in <b>/wp-content/plugins/akismet/akismet.php</b> on line <b>306</b><br />
<br />
<b>Notice</b>:  Undefined index: comment_author_email in <b>/wp-includes/comment.php</b> on line <b>1200</b><br />
<br />
<b>Notice</b>:  Undefined index: comment_author_email in <b>/wp-content/plugins/akismet/akismet.php</b> on line <b>262</b><br />
<br />
<b>Warning</b>:  Cannot modify header information - headers already sent by (output started at /wp-includes/rewrite.php:302) in <b>/wp-includes/class-IXR.php</b> on line <b>395</b><br />
<br />
<b>Warning</b>:  Cannot modify header information - headers already sent by (output started at /wp-includes/rewrite.php:302) in <b>/wp-includes/class-IXR.php</b> on line <b>396</b><br />
<br />
<b>Warning</b>:  Cannot modify header information - headers already sent by (output started at /wp-includes/rewrite.php:302) in <b>/wp-includes/class-IXR.php</b> on line <b>397</b><br />
<br />
<b>Warning</b>:  Cannot modify header information - headers already sent by (output started at /wp-includes/rewrite.php:302) in <b>/wp-includes/class-IXR.php</b> on line <b>398</b><br />
<?xml version="1.0"?>
<methodResponse>
  <params>
    <param>
      <value>
        <string>Pingback from http://foo.com/ to http://bar.com/ registered. Keep the web talking! :-)</string>
      </value>
    </param>
  </params>
</methodResponse

Change History (5)

#1 @greuben
13 years ago

  • Keywords reporter-feedback added

Can't reproduce this in trunk..
this is the code I've used

include('IXR_Library.php');
$client = new IXR_Client('http://localhost.local/xmlrpc.php');
$client->debug = true;
$client->query('pingback.ping' ,'http://localhost/', 'http://localhost.local/2011/02/hello-world/');

response

POST /xmlrpc.php HTTP/1.0
Host: localhost.local
Content-Type: text/xml
User-Agent: The Incutio XML-RPC PHP Library
Content-Length: 259

<?xml version="1.0"?>
<methodCall>
<methodName>pingback.ping</methodName>
<params>
<param><value><string>http://localhost/</string></value></param>
<param><value><string>http://localhost.local/blog/2011/02/hello-world/</string></value></param>
</params></methodCall>
HTTP/1.1 200 OK
Date: Tue, 15 Feb 2011 09:32:32 GMT
Server: Apache/2.2.17
X-Powered-By: PHP/5.3.4
Connection: close
Content-Length: 281
Content-Type: text/xml

<?xml version="1.0"?>
<methodResponse>
  <params>
    <param>
      <value>
      <string>Pingback from http://localhost/ to http://localhost.local/blog/2011/02/hello-world/ registered. Keep the web talking! :-)</string>
      </value>
    </param>
  </params>
</methodResponse>

maybe a plugin issue?

#2 @nacin
13 years ago

  • Description modified (diff)
  • Keywords reporter-feedback removed
  • Severity changed from major to normal

Undefined index: path in /wp-includes/rewrite.php on line 302

That one is legitimate. The rest are possibly akismet. Not sure what would cause line 341. (fyi, on 3.0.5 tag.)

home_url() is not trailing-slashed. That means that parse_url() won't set a path.

Changing home_url() to home_url('/') fixes this. There are possibly other instances in the codebase where we parse_url() home_url().

#3 @solarissmoke
13 years ago

The undefined index is fixed in [16069]

Last edited 13 years ago by solarissmoke (previous) (diff)

#4 @greuben
13 years ago

line 341 is fixed in [16877]

Last edited 13 years ago by greuben (previous) (diff)

#5 @nacin
13 years ago

  • Description modified (diff)

I don't see how [16877] fixes anything. It uses cleaner code, but is_singular == is_single || is_page. (There's also an is_attachment there, but whenever is_attachment is true, is_single xor is_page is true.)

Note: See TracTickets for help on using tickets.