[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 01:24:39 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 KProvance):

 `Using the filter hook 'the_content' and passing an empty string or null
 produces the preg_split deprecation notice in the convert_smilies()
 function.`

 I thought I made this clear with that statement. Pass an empty string or
 null to a 'the_content' filter. In turn, this passes the null/empty string
 to the `convert_smiles()` function and, in turn, the error. How does one
 fix a null or blank string passed to the 'the_content' filter past not
 doing it? Sometimes, there is no content. @mecano had the correct
 solution.

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


More information about the wp-trac mailing list