Make WordPress Core

Opened 4 months ago

Closed 4 months ago

#57605 closed defect (bug) (duplicate)

Fix PHP8.1 Deprecation notices passing null

Reported by: afragen's profile afragen Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Formatting Keywords: has-patch php8.1
Focuses: Cc:

Description

While testing a feature that occurs during an auto-update, in wp-cron, I found PHP deprecation notices that only occur in PHP8.1. What is happening is null is being passed to certain functions who expect to see a string.

Simply type casting the variable fixes the issue.

Change History (2)

This ticket was mentioned in PR #3965 on WordPress/wordpress-develop by @afragen.


4 months ago
#1

In testing Rollback during an auto-update I discovered some PHP Deprecation notices that only occur in PHP8.1 as null is the passed value. Both of these values should be strings. These are easily fixed by type casting.

Trac ticket: https://core.trac.wordpress.org/ticket/57605#ticket

#2 @ocean90
4 months ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed
  • Version trunk deleted

Duplicate of #56850 and #56434.

Note: See TracTickets for help on using tickets.