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.

git-svn-id: https://develop.svn.wordpress.org/trunk@45707 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2019-08-01 02:24:08 +00:00
parent a875f9dae7
commit 1878f25e54

View File

@ -2092,7 +2092,7 @@ class wpdb {
* Add the filter to remove the placeholder escaper. Uses priority 0, so that anything
* else attached to this filter will receive the query with the placeholder string removed.
*/
if ( ! has_filter( 'query', array( $this, 'remove_placeholder_escape' ) ) ) {
if ( false === has_filter( 'query', array( $this, 'remove_placeholder_escape' ) ) ) {
add_filter( 'query', array( $this, 'remove_placeholder_escape' ), 0 );
}