Passing null to parameter #1 ($string) of type string is deprecated in xmlrpc_value_get_xml()

Created on 19 April 2023, over 1 year ago
Updated 9 April 2024, 8 months ago

Problem/Motivation

When a value passed to a XML-RPC request is NULL there is the following PHP notice on PHP 8.1:

Deprecated function: htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated in xmlrpc_value_get_xml()

Steps to reproduce

xmlrpc('http://www.example.com', [
  'foo.method' => [
    'bar' => NULL,
  ],
]);

Proposed resolution

When a value is NULL, generate the following XML:
<nil />

Remaining tasks

  • Review
  • Commit

User interface changes

API changes

Data model changes

A fix + tests will follow.

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇳🇱Netherlands megachriz

Live updates comments and jobs are added and updated live.
  • PHP 8.1

    The issue particularly affects sites running on PHP version 8.1.0 or later.

Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024