Make WordPress Core

Opened 11 months ago

Last modified 9 months ago

#59052 new defect (bug)

Deprecated: html_entity_decode(): Passing null to parameter #1 ($string) of type string is deprecated in wp-includes/widgets.php on line 1626

Reported by: treibstoff's profile treibstoff Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 6.3
Component: General Keywords: php81 needs-patch
Focuses: Cc:

Description

Since the change to PHP 8.1 (from 8, WP 6.3 is now running, I get once a day, only while opening the dashboard this Warnings (repeating twice):


"PHP Deprecated:  html_entity_decode(): Passing null to parameter #1 ($string) of type string is deprecated in /homepages/xxx/wp-includes/widgets.php on line 1626"

Only once day I'm logged in. After reloading or new login on the same day, the Warning doesn't show up.
This happens on three different Installations.
On one Installation I deactivated all Plugins and changed the theme to fresh Twenty Twenty Two.

But still once a day the warning just after first login.

The Cron-Jobs running, are only from WP, see below.

Searched Google about this warning, I got no result about this warning in releation with "html_entity_decode()" & "wp-includes/widgets.php on line 1626"

So, I'm not sure this is a known bug in WP Core onto PHP 8.1

Any suggestion would be welcome.

the Cron-Jobs running
"wp_privacy_delete_old_export_files,wp_privacy_delete_old_export_files(),""once every hour""
"recovery_mode_clean_expired_keys,WP_Recovery_Mode->clean_expired_keys(),""once a day""
"wp_https_detection,wp_update_https_detection_errors(),""twice a day""
"wp_version_check,wp_version_check(),""twice a day""
"wp_update_plugins,wp_update_plugins(),""twice a day""
"wp_update_themes,wp_update_themes(),""twice a day""
"wp_scheduled_delete,wp_scheduled_delete(),""once a day""
"delete_expired_transients,delete_expired_transients(),""once a day""
"wp_scheduled_auto_draft_delete,wp_delete_auto_drafts(),""once a day""
"wp_update_user_counts,wp_schedule_update_user_counts(),""twice a day""
"wp_site_health_scheduled_check,WP_Site_Health->wp_cron_scheduled_check(),""once weekly""
"wp_delete_temp_updater_backups,2023-08-16 16:33:02 6 Tage, wp_delete_all_temp_backups(),""once weekly""
publish_future_post,[7],2040-09-03 03:02:56 17 Jahre, check_and_publish_future_post(),one-shot,0

Change History (6)

#1 follow-up: @craigfrancis
11 months ago

Hi @treibstoff, there is a summary about these errors at WordPress 5.9 and PHP 8.0-8.1.

I'm not sure if/where @jrf is tracking them now, as #54730 has been closed?

Personally I think PHP should revert before PHP 9 throws an exception when this happens - considering other variable types (e.g. integers) are coerced without issue, and NULL is coerced in other contexts (e.g. concatenation).

#2 follow-up: @jrf
11 months ago

  • Keywords php81 needs-patch added

@treibstoff Thanks for reporting this.

In contrast to most reports of this kind (which are caused by plugins/themes doing it wrong), this does actually look like something which should be handled/fixed in WP Core in the wp_widget_rss_output() function.

It appears that the RSS feed/URL is missing the description element and the code looping through the RSS feed items doesn't take that possibility into account.
By the looks of it (based on a quick glance), it also doesn't correctly handle the possibility that other expected elements could be missing.

While it is debatable whether that makes the RSS feed invalid (would need checking against the RSS specifications/RFC), I do think WP should handle this gracefully.

#3 in reply to: ↑ 1 @jrf
11 months ago

Replying to craigfrancis:

I'm not sure if/where @jrf is tracking them now, as #54730 has been closed?

@craigfrancis Issues related to various PHP versions are tracked using the php* keywords. There is also the new "php-compatibility" focus, though that should only be used selectively.

Last edited 11 months ago by jrf (previous) (diff)

#4 in reply to: ↑ 2 @treibstoff
9 months ago

Replying to jrf:

@treibstoff Thanks for reporting this.

In contrast to most reports of this kind (which are caused by plugins/themes doing it wrong), this does actually look like something which should be handled/fixed in WP Core in the wp_widget_rss_output() function.

I guess you're right. It is a core problem!!!

Meanwhile I found that the view of the "community-events" on the dashboard caused the problem.

Looking for an unserelize-Php Error onto the query-Monitor
I found that the Transient for:
_site_transient_community-events-3383c416d96e7e74e08084a6fca31eaf
caused the unserelize-message.

So, if I delete that transient & delete the View of Community-Events from the Dashboard the message is gone.

If I'm also delete than the Transient for:
_transient_dash_v2_898c881de4a92ca37616885905bba3b7

and
_transient_feed_f014c832422b67a4cec692b17aa40756

finally the message for "Deprecated: html_entity_decode()"
is gone.

This not really a solution, as I want to see the community-events on the dashboard.
but it is a core bug.

All Values of the transients you find below:

_site_transient_community-events-3383c416d96e7e74e08084a6fca31eaf

Value:
a:4:{s:9:"sandboxed";b:0;s:5:"error";N;s:8:"location";a:1:{s:2:"ip";s:12:"89.247.174.0";}s:6:"events";a:4:{i:0;a:10:{s:4:"type";s:6:"meetup";s:5:"title";s:30:"WordPress Meetup Potsdam 10/23";s:3:"url";s:56:"https://www.meetup.com/wpmeetup-potsdam/events/291514399";s:6:"meetup";s:24:"WordPress Meetup Potsdam";s:10:"meetup_url";s:40:"https://www.meetup.com/wpmeetup-potsdam/";s:4:"date";s:19:"2023-10-09 19:00:00";s:8:"end_date";s:19:"2023-10-09 21:00:00";s:20:"start_unix_timestamp";i:1696870800;s:18:"end_unix_timestamp";i:1696878000;s:8:"location";a:4:{s:8:"location";s:16:"Potsdam, Germany";s:7:"country";s:2:"de";s:8:"latitude";d:52.388073;s:9:"longitude";d:13.119469;}}i:1;a:10:{s:4:"type";s:8:"wordcamp";s:5:"title";s:17:"WordCamp Wroc?aw";s:3:"url";s:34:"https://wroclaw.wordcamp.org/2023/";s:6:"meetup";N;s:10:"meetup_url";N;s:4:"date";s:19:"2023-10-21 09:00:00";s:8:"end_date";s:19:"2023-10-21 09:00:00";s:20:"start_unix_timestamp";i:1697871600;s:18:"end_unix_timestamp";i:1697871600;s:8:"location";a:4:{s:8:"location";s:8:"Wroc?aw";s:7:"country";s:2:"PL";s:8:"latitude";d:51.101379;s:9:"longitude";d:17.0280691;}}i:2;a:10:{s:4:"type";s:6:"meetup";s:5:"title";s:30:"WordPress Meetup Potsdam 11/23";s:3:"url";s:56:"https://www.meetup.com/wpmeetup-potsdam/events/291514411";s:6:"meetup";s:24:"WordPress Meetup Potsdam";s:10:"meetup_url";s:40:"https://www.meetup.com/wpmeetup-potsdam/";s:4:"date";s:19:"2023-11-13 19:00:00";s:8:"end_date";s:19:"2023-11-13 21:00:00";s:20:"start_unix_timestamp";i:1699898400;s:18:"end_unix_timestamp";i:1699905600;s:8:"location";a:4:{s:8:"location";s:16:"Potsdam, Germany";s:7:"country";s:2:"de";s:8:"latitude";d:52.407284;s:9:"longitude";d:13.055186;}}i:3;a:10:{s:4:"type";s:6:"meetup";s:5:"title";s:69:"#wpdm 12/23 - Potsdam & Xmas & Berlin - Glühwein im Weihnachtsmarkt";s:3:"url";s:56:"https://www.meetup.com/wpmeetup-potsdam/events/291514434";s:6:"meetup";s:24:"WordPress Meetup Potsdam";s:10:"meetup_url";s:40:"https://www.meetup.com/wpmeetup-potsdam/";s:4:"date";s:19:"2023-12-13 19:00:00";s:8:"end_date";s:19:"2023-12-13 22:00:00";s:20:"start_unix_timestamp";i:1702490400;s:18:"end_unix_timestamp";i:1702501200;s:8:"location";a:4:{s:8:"location";s:15:"Berlin, Germany";s:7:"country";s:2:"de";s:8:"latitude";d:52.52093;s:9:"longitude";d:13.295616;}}}}

_transient_feed_f014c832422b67a4cec692b17aa40756

Value:
a:4:{s:5:"child";a:1:{s:0:"";a:1:{s:3:"rss";a:1:{i:0;a:6:{s:4:"data";s:3:"

";s:7:"attribs";a:1:{s:0:"";a:1:{s:7:"version";s:3:"2.0";}}s:8:"xml_base";s:0:"";s:17:"xml_base_explicit";b:0;s:8:"xml_lang";s:0:"";s:5:"child";a:1:{s:0:"";a:1:{s:7:"channel";a:1:{i:0;a:6:{s:4:"data";s:52:"

_transient_dash_v2_898c881de4a92ca37616885905bba3b7
Value:
<div class="rss-widget"><ul><li><a class='rsswidget' href='https://de.wordpress.org/2023/08/wordpress-6-3/'>WordPress 6.3 »Lionel«</a></li><li><a class='rsswidget' href='https://de.wordpress.org/2023/05/wordpress-6-2-2-und-6-2-1-sicherheits-releases/'>WordPress 6.2.2 und 6.2.1 Sicherheits-Releases</a></li></ul></div><div class="rss-widget"><ul><li><a class='rsswidget' href='https://www.perun.net/2023/09/27/wordpress-6-4-bringt-ein-neues-standard-theme/'>WordPress 6.4 bringt ein neues Standard-Theme</a></li><li><a class='rsswidget' href='https://elektroelch.de/blog/javascript-module-in-wordpress-plugins-nutzen/'>JavaScript-Module in WordPress-Plugins nutzen</a></li><li><a class='rsswidget' href='https://haurand.com/wordpress-6-3-quadratische-bilder/'>WordPress 6.3: Quadratische Bilder mit Aspect Ratio beim Image Block</a></li></ul></div>

#5 @treibstoff
9 months ago

In addition to my last comment:

I just updated another wordpress installation from PhP 8 to PHP 8.1
and the same issue with "Deprecated: html_entity_decode()" starts. The commmunity-events on dashbord is on.

if I delete the View of Community-Events from the Dashboard & delete the related transient the message is gone.

#6 @jrf
9 months ago

#59554 was marked as a duplicate.

Note: See TracTickets for help on using tickets.