[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
Wed Apr 24 16:20:28 UTC 2024


#59195: deprecation notice triggered in post.php by passing null to parameter #2 in
preg_match()
-------------------------------------------------+-------------------------
 Reporter:  nosilver4u                           |       Owner:  (none)
     Type:  defect (bug)                         |      Status:  new
 Priority:  normal                               |   Milestone:  Awaiting
                                                 |  Review
Component:  Media                                |     Version:  6.3
 Severity:  normal                               |  Resolution:
 Keywords:  php81 changes-requested needs-unit-  |     Focuses:  php-
  tests needs-patch                              |  compatibility
-------------------------------------------------+-------------------------

Comment (by nosilver4u):

 With #2, do you mean converting the null values within
 `get_available_post_mime_types()` to `''`? Otherwise, once null values are
 in the db, I think WP needs to be able to handle the null values without
 issues, and then #1 would make the most sense.

 Either way, I would lean towards #1, as it doesn't seem particularly
 useful to return an empty mime type from
 `get_available_post_mime_types()`. That is, unless there is some code that
 allows querying for the attachments with an empty mime?
 In the media library, I'm only seeing filters for known upload types, so
 an empty type certainly isn't helpful there. Oddly, I get Spreadsheets in
 grid view, but not in list view, that's unexpected...

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


More information about the wp-trac mailing list