[wp-trac] [WordPress Trac] #51019: convert_smilies() fails on large tags

WordPress Trac noreply at wordpress.org
Sat Aug 15 12:51:26 UTC 2020


#51019: convert_smilies() fails on large tags
--------------------------+-----------------------------
 Reporter:  podpirate     |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:  5.5
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 I have an image with huge data-url src (1.6M) in the post content.
 The post content is not displayed, but (with `WP_DEBUG` on) there is a php
 error instead.

 PHP Error output:
 {{{
  Warning: count(): Parameter must be an array or an object that implements
 Countable in /Users/joern/www/vhosts/wordpress.local/httpdocs/stable/wp-
 includes/formatting.php on line 3357
 }}}

 Som digging revealed, that `preg_split()` in `function convert_smilies()`
 fails with a `PREG_RECURSION_LIMIT_ERROR`.

 IMHO there should a check for `preg_last_error()` whether `preg_split()`
 was successfull, and if not the function should just return its input.

 Any thoughts on this?
 I'd be happy to craft a patch.

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


More information about the wp-trac mailing list