WordPress.org

Make WordPress Core

Opened 5 weeks ago

Last modified 5 weeks ago

#51019 new defect (bug)

convert_smilies() fails on large tags

Reported by: podpirate Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 5.5
Component: Formatting Keywords: needs-patch
Focuses: Cc:

Description

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.

Change History (1)

#1 @SergeyBiryukov
5 weeks ago

  • Component changed from General to Formatting
  • Keywords needs-patch added

Hi there, welcome back to WordPress Trac! Thanks for the ticket.

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

Makes sense to me :)

Note: See TracTickets for help on using tickets.