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.
Built from https://develop.svn.wordpress.org/trunk@45707


git-svn-id: http://core.svn.wordpress.org/trunk@45518 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov
2019-08-01 02:25:56 +00:00
parent 5f9ba92af4
commit 2d574d673f
2 changed files with 2 additions and 2 deletions

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 );
}