Make WordPress Core

Opened 5 months ago

Closed 4 months ago

#58728 closed defect (bug) (invalid)

Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated

Reported by: ispreview's profile ispreview Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Formatting Keywords: php81 close
Focuses: coding-standards Cc:


I recently did a test of PHP 8.2.7 on the latest WordPress 6.2.2 release (this might also occur under PHP 8.1 as I didn't test that) and enabled debugging, which resulted in quite a few of these errors through the admin dashboard. I haven't been able to test every section as when I enable debugging this error also kills (completely vanished) the WordPress Admin menu on the left side of the screen, which I assume to be related.

Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /../wp-includes/functions.php on line 7053

I also created another ticket for a similar bug, albeit in a different part of the same file:

Change History (5)

#1 @audrasjb
5 months ago

  • Focuses coding-standards added
  • Keywords needs-patch added
  • Version 6.2.2 deleted

#2 @jrf
5 months ago

  • Keywords php81 added

@ispreview That will need a backtrace as this is likely caused by a plugin or theme doing something wrong. If not, we still need to know where in Core to fix the incorrect function call as the function in the functions.php file is passed incorrect information, which should be fixed at the point the information is passed, not where it is received (which is where the deprecation is being thrown).

#3 @ispreview
5 months ago

I disabled all the plugins and found that the one causing this issue occurs when the latest release of Blog2Social (v7.1.2) is enabled.

#4 @jrf
5 months ago

  • Keywords close added; needs-patch removed

@ispreview Thank you for figuring that out. I suggest you report this to the author of the Blog2Social plugin in that case.

#5 @hellofromTonya
4 months ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

It appears the issue was with a plugin. Thank you everyone for your contributions!

Note: See TracTickets for help on using tickets.