Make WordPress Core


Ignore:
Timestamp:
05/17/2023 10:44:21 PM (11 months ago)
Author:
westonruter
Message:

General: Use static on closures whenever $this is not used to avoid memory leaks.

Props westonruter, jrf, spacedmonkey.
Fixes #58323.

File:
1 edited

Legend:

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

    r55749 r55822  
    48274827             * array_walk_recursive() does not return an array.
    48284828             */
    4829             function ( &$value ) use ( $wpdb, $placeholder ) {
     4829            static function ( &$value ) use ( $wpdb, $placeholder ) {
    48304830                if ( is_string( $value ) && str_contains( $value, $placeholder ) ) {
    48314831                    $value = $wpdb->remove_placeholder_escape( $value );
Note: See TracChangeset for help on using the changeset viewer.