[wp-trac] [WordPress Trac] #60003: PHP error in wp_match_mime_types() (was: php error)

WordPress Trac noreply at wordpress.org
Sat Dec 2 21:55:46 UTC 2023


#60003: PHP error in wp_match_mime_types()
-------------------------------+------------------------------
 Reporter:  argaliano15        |       Owner:  (none)
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  General            |     Version:  6.4
 Severity:  normal             |  Resolution:
 Keywords:  reporter-feedback  |     Focuses:
-------------------------------+------------------------------
Changes (by sabernhardt):

 * keywords:   => reporter-feedback


Old description:

> PHP ERROR:
>
> Deprecated: preg_match(): Passing null to parameter #2 ($subject) of type
> string is deprecated in /home1/njscuban/public_html/luthierylabs/wp-
> includes/post.php on line 3308
>
> FIX:
>
> change LINE 3308 to:
>
> if ( $real && preg_match( "#$pattern#", $real )
>      ^^^^^^^^^

New description:

 PHP ERROR:

 `Deprecated: preg_match(): Passing null to parameter #2 ($subject) of type
 string is deprecated in /.../wp-includes/post.php on line 3308`

 FIX:

 change LINE 3308 to:

 {{{
 if ( $real && preg_match( "#$pattern#", $real )
      ^^^^^^^^^
 }}}

--

Comment:

 Hi and welcome to WordPress Core Trac!

 The `wp_match_mime_types()` function has always required a string or an
 array of strings for both parameters (r6910).

 Could you check for a stack trace and/or deactivate plugins individually
 to determine where the function was used?

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


More information about the wp-trac mailing list