Make WordPress Core

Opened 4 weeks ago

Last modified 4 weeks ago

#47430 reviewing defect (bug)

wp-db: Always adds a filter on every query

Reported by: withinboredom Owned by: SergeyBiryukov
Milestone: 5.3 Priority: normal
Severity: minor Version: 5.2.1
Component: Database Keywords: has-patch
Focuses: Cc:


It appears that in the function placeholder_escape it adds a filter remove_placeholder_escape. It adds a filter with the priority of 0. However, has_filter doesn't return true or false, it returns the priority. Since the priority is 0, it always adds a filter on every call. This issue is minor because WP_Hook prevents the infinite loop that would occur, however, it still causes a small amount of memory to be used and causes a small performance penalty.

Attachments (2)

fix_has_filter_check.patch (746 bytes) - added by withinboredom 4 weeks ago.
fix_has_filter_check.2.patch (746 bytes) - added by withinboredom 4 weeks ago.
Previous patch was incorrect

Download all attachments as: .zip

Change History (3)

#1 @SergeyBiryukov
4 weeks ago

  • Milestone changed from Awaiting Review to 5.3
  • Owner set to SergeyBiryukov
  • Status changed from new to reviewing

4 weeks ago

Previous patch was incorrect

Note: See TracTickets for help on using tickets.