[wp-trac] [WordPress Trac] #59195: deprecation notice triggered in post.php by passing null to parameter #2 in preg_match()

WordPress Trac noreply at wordpress.org
Tue Jun 18 14:11:09 UTC 2024


#59195: deprecation notice triggered in post.php by passing null to parameter #2 in
preg_match()
-------------------------------------------------+-------------------------
 Reporter:  nosilver4u                           |       Owner:
                                                 |  hellofromTonya
     Type:  defect (bug)                         |      Status:  reviewing
 Priority:  normal                               |   Milestone:  6.6
Component:  Media                                |     Version:  6.3
 Severity:  normal                               |  Resolution:
 Keywords:  php81 has-patch has-unit-tests has-  |     Focuses:  php-
  testing-info commit                            |  compatibility
-------------------------------------------------+-------------------------
Changes (by hellofromTonya):

 * keywords:  php81 has-patch has-unit-tests needs-testing has-testing-info
     => php81 has-patch has-unit-tests has-testing-info commit
 * owner:  (none) => hellofromTonya
 * status:  new => reviewing


Comment:

 Patch: https://github.com/WordPress/wordpress-develop/pull/6443

 I agree the root cause is `get_available_post_mime_types()` returning a
 `null` element. This function is documented to return an array of `string`
 MIME types. It should not be nullable. And an empty element is not a valid
 MIME type.

 The patch addresses the root cause of the deprecation notice  ✅, as
 confirmed by multiple test reports and my own testing.

 Marking the patch for commit and will commit shortly for 6.6 Beta 3.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/59195#comment:19>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list