Make WordPress Core

Ticket #49144: 49144-2.diff

File 49144-2.diff, 837 bytes (added by jeherve, 5 years ago)

Ensure that we pass a full path

  • src/wp-includes/script-loader.php

     
    285285        );
    286286        foreach ( $packages as $package ) {
    287                 $handle       = 'wp-' . $package;
    288                 $path         = "/wp-includes/js/dist/$package$suffix.js";
    289                 $asset_file   = include( ABSPATH . WPINC . "/assets/dist/$package$suffix.asset.php" );
     287                $handle = 'wp-' . $package;
     288                $path   = "/wp-includes/js/dist/$package$suffix.js";
     289
     290                if ( ! file_exists( ABSPATH . $path ) ) {
     291                        continue;
     292                }
     293
     294                $asset_file   = include ABSPATH . WPINC . "/assets/dist/$package$suffix.asset.php";
    290295                $dependencies = $asset_file['dependencies'];
    291296                // Add dependencies that cannot be detected and generated by build tools.