Make WordPress Core


Ignore:
Timestamp:
05/17/2023 10:44:21 PM (14 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-admin/includes/file.php

    r55750 r55822  
    26862686     * @param string $path    Absolute path to the directory.
    26872687     */
    2688     $invalidate_directory = function( $dirlist, $path ) use ( &$invalidate_directory ) {
     2688    $invalidate_directory = static function( $dirlist, $path ) use ( &$invalidate_directory ) {
    26892689        $path = trailingslashit( $path );
    26902690
Note: See TracChangeset for help on using the changeset viewer.