Make WordPress Core

Opened 9 years ago

Closed 9 years ago

Last modified 8 years ago

#10623 closed defect (bug) (fixed)

wp_kses_decode_entities() calls create_function() each time called

Reported by: mdawaffe Owned by:
Milestone: 2.9 Priority: normal
Severity: normal Version: 2.9
Component: Optimization Keywords: has-patch commit
Focuses: Cc:


Every time wp_kses_decode_entities() is called, create_function() is called twice.

wp_kses_decode_entities() is called at least once in most KSES calls and once in all clean_url() calls. This can result in hundreds of create_function()s on normal pages and thousands on edge pages.

All these create_function()s eat up memory, which can, in edge cases, cause a fatal memory allocation error.

Since these create_function() calls are not used to generate actual dynamic code, there's no reason they cannot be replaced with hardcoded functions.


Attachments (1)

10623.diff (1.2 KB) - added by mdawaffe 9 years ago.

Download all attachments as: .zip

Change History (3)

9 years ago

#1 @azaozz
9 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [11828]) Do not use lambda functions in wp_kses_decode_entities(), props mdawaffe, fixes #10623

#2 @Denis-de-Bernardy
8 years ago

  • Milestone changed from Unassigned to 2.9
Note: See TracTickets for help on using tickets.