From 1878f25e54ed0afbcd82a2247706265e47f69af0 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Thu, 1 Aug 2019 02:24:08 +0000 Subject: [PATCH] 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 --- src/wp-includes/wp-db.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-includes/wp-db.php b/src/wp-includes/wp-db.php index 4f8223fc4b..98eba1bc29 100644 --- a/src/wp-includes/wp-db.php +++ b/src/wp-includes/wp-db.php @@ -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 ); }