WordPress.org

Make WordPress Core

Ticket #42401: wp-db.diff

File wp-db.diff, 613 bytes (added by mkomar, 3 years ago)

patch to resolve the problem.

  • wp-includes/wp-db.php

     
    19461946                        // If ext/hash is not present, compat.php's hash_hmac() does not support sha256.
    19471947                        $algo = function_exists( 'hash' ) ? 'sha256' : 'sha1';
    19481948                        // Old WP installs may not have AUTH_SALT defined.
    1949                         $salt = defined( 'AUTH_SALT' ) ? AUTH_SALT : rand();
     1949                        $salt = defined( 'AUTH_SALT' ) ? AUTH_SALT : (string) rand();
    19501950
    19511951                        $placeholder = '{' . hash_hmac( $algo, uniqid( $salt, true ), $salt ) . '}';
    19521952                }