WordPress.org

Make WordPress Core

Ticket #42431: 42431.diff

File 42431.diff, 647 bytes (added by pento, 2 years ago)
  • src/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 : (string) rand();
     1949                        $salt = defined( 'AUTH_SALT' ) && AUTH_SALT ? AUTH_SALT : (string) rand();
    19501950
    19511951                        $placeholder = '{' . hash_hmac( $algo, uniqid( $salt, true ), $salt ) . '}';
    19521952                }