[wp-trac] [WordPress Trac] #63131: Possible bug (not strict) use of preg_split in formatting.php

WordPress Trac noreply at wordpress.org
Thu Mar 20 09:54:47 UTC 2025


#63131: Possible bug (not strict) use of preg_split in formatting.php
--------------------------+-----------------------------
 Reporter:  pjsgsy        |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Formatting    |    Version:
 Severity:  minor         |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 Hello,

 With PHP 8.4 and the latest 6.7.2, I get and error on my home page (using
 Salient theme if that matters).

 The error is on line 3479 in formatting.php

 $textarr = preg_split( '/(<.*>)/U', $text, -1, PREG_SPLIT_DELIM_CAPTURE );
 // Capture the tags as well as in between.

 This breaks the home page. it seems to be a lexical warning more than
 anything else so it can be fixed by suppressing the error

 $textarr = @preg_split( '/(<.*>)/U', $text, -1, PREG_SPLIT_DELIM_CAPTURE
 ); // Capture the tags as well as in between.

 This resolves the issue.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/63131>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list