[wp-trac] [WordPress Trac] #51956: Fatal error with PHP8 in header link RSS feed on dashboard widget

WordPress Trac noreply at wordpress.org
Mon Dec 7 14:18:24 UTC 2020


#51956: Fatal error with PHP8 in header link RSS feed on dashboard widget
--------------------------+-----------------------------
 Reporter:  NicolasKulka  |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:
 Severity:  normal        |   Keywords:  needs-patch
  Focuses:                |
--------------------------+-----------------------------
 I just found an issue with a native WordPress RSS feed on a category.

 It returns 2 different links via the rest_output_link_wp_head function in
 the wp-includes/rest-api.php file.

 Example : https://www.wpserveur.net/securite-wps/feed/
 Link: <https://www.wpserveur.net/wp-json/>; rel="https://api.w.org/"
 Link: <https://www.wpserveur.net/wp-json/wp/v2/categories/45>;
 rel="alternate";

 I created a widget on the dashboard via this rss feed with the
 wp_dashboard_primary_output function.

 With PHP 7.4 => Warning: preg_match() expects parameter 2 to be string,
 array given in /wp-includes/class-simplepie.php on line 2620

 With PHP 8.0 => Fatal error: Uncaught TypeError: preg_match(): Argument #2
 ($subject) must be of type string, array given in /wp-includes/class-
 simplepie.php:2620

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/51956>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list