Make WordPress Core


Ignore:
Timestamp:
08/01/2019 02:24:08 AM (5 years ago)
Author:
SergeyBiryukov
Message:

Database: Use a strict comparison for has_filter() check in wpdb::placeholder_escape().

The filter is added with a priority of 0, so a loose comparison had an unintended effect of adding the filter on every call.

Props withinboredom.
Fixes #47430.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/wp-db.php

    r45639 r45707  
    20932093         * else attached to this filter will receive the query with the placeholder string removed.
    20942094         */
    2095         if ( ! has_filter( 'query', array( $this, 'remove_placeholder_escape' ) ) ) {
     2095        if ( false === has_filter( 'query', array( $this, 'remove_placeholder_escape' ) ) ) {
    20962096            add_filter( 'query', array( $this, 'remove_placeholder_escape' ), 0 );
    20972097        }
Note: See TracChangeset for help on using the changeset viewer.