Make WordPress Core

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#43216 closed defect (bug) (fixed)

IXR Server Warning

Reported by: eatonz's profile EatonZ Owned by: dd32's profile dd32
Milestone: 4.9.5 Priority: normal
Severity: normal Version: 4.9.2
Component: XML-RPC Keywords: fixed-major commit
Focuses: Cc:

Description

I've recently upgraded my site to PHP 7.2 and started getting these in the logs:

PHP Warning:  count(): Parameter must be an array or an object that implements Countable in \wp-includes\IXR\class-IXR-server.php on line 101

This is due to a PHP 7.2 change - you need to update this file for PHP 7.2.

PS: Not sure what IXR is, so I'm assigning it to "General".

Change History (7)

#1 @SergeyBiryukov
7 years ago

  • Component changed from General to XML-RPC
  • Milestone changed from Awaiting Review to 4.9.4

#2 @redsweater
7 years ago

I'm assuming this is a runtime log message and not something that PHP logs while simply loading/parsing the file.

The line of code where it occurs indicates that the WordPress instance in question is being connected to by an XMLRPC client who invoking method with no parameters. The vast majority of supported XMLRPC methods require parameters, but for example "demo.sayHello" does not. I imagine invoking that method on such a system would exhibit the problem.

#3 @dd32
7 years ago

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

In 42652:

XML-RPC: Add default values to IXR_Message for PHP 7.2 compatibility to avoid PHP Warnings.

Fixes #43216 for trunk.

#4 @dd32
7 years ago

  • Keywords fixed-major commit added
  • Resolution fixed deleted
  • Status changed from closed to reopened

re-opening for 4.9 backport once verified fixed.

I used the following to trigger it:

curl -X POST http://wordpress-develop/src/xmlrpc.php -d '<?xml version="1.0"?><methodCall><methodName>demo.sayHello</methodName></methodCall>'

#5 @dd32
7 years ago

  • Milestone changed from 4.9.4 to 4.9.5

Bumping, 4.9.4 has been released.

#6 @SergeyBiryukov
7 years ago

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

In 42806:

XML-RPC: Add default values to IXR_Message for PHP 7.2 compatibility to avoid PHP Warnings.

Props dd32.
Merges [42652] to the 4.9 branch.
Fixes #43216.

#7 @dd32
7 years ago

It's been mentioned elsewhere that the changes in [42652] may not be compatible with existing uses, specifically the = false; additions.

Although there's unlikely to be any side effects of this, I'm commenting to say that only the = array() change was really needed here, and the rest was mostly just irrelevant.

Note: See TracTickets for help on using tickets.