[wp-trac] [WordPress Trac] #58476: preg_split(): Passing null to parameter #2 ($subject) of type string is deprecated

WordPress Trac noreply at wordpress.org
Tue Nov 28 00:38:03 UTC 2023


#58476: preg_split(): Passing null to parameter #2 ($subject) of type string is
deprecated
-------------------------------+------------------------------
 Reporter:  KProvance          |       Owner:  (none)
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Posts, Post Types  |     Version:  6.3
 Severity:  normal             |  Resolution:
 Keywords:                     |     Focuses:
-------------------------------+------------------------------

Comment (by jrf):

 Duplicate of #58275.

 This needs a backtrace to see where the error originates from.

 The `convert_smilies()` function is clearly marked as only accepting
 `string` values for `$text`.

 The current proposed patch would widen the parameter type to `?string` and
 ''hide'' the error instead of fixing it.

 This should be fixed in the location where `null` is being ''passed'' to
 `convert_smilies()` instead.

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


More information about the wp-trac mailing list