Make WordPress Core

Ticket #57725: 57725.diff

File 57725.diff, 630 bytes (added by sakibmd, 22 months ago)

If we can want to use wp_rand() instead of rand() then it could be solution.

  • src/wp-admin/includes/file.php

    diff --git a/src/wp-admin/includes/file.php b/src/wp-admin/includes/file.php
    index 774f3b0151..7a37e04cc4 100644
    a b function wp_edit_theme_plugin_file( $args ) { 
    521521
    522522        if ( $is_active && 'php' === $extension ) {
    523523
    524                 $scrape_key   = md5( rand() );
     524                $scrape_key   = md5( wp_rand() );
    525525                $transient    = 'scrape_key_' . $scrape_key;
    526                 $scrape_nonce = (string) rand();
     526                $scrape_nonce = (string) wp_rand();
    527527                // It shouldn't take more than 60 seconds to make the two loopback requests.
    528528                set_transient( $transient, $scrape_nonce, 60 );
    529529