Make WordPress Core

Changeset 42233


Ignore:
Timestamp:
11/27/2017 01:09:11 AM (7 years ago)
Author:
dd32
Message:

WPDB: Check that AUTH_SALT is not empty, Fix a PHP notice when AUTH_SALT is undefined.

Props jsonfry, mkomar, pento.
Merges [42119] and [42120] to the 4.5 branch.
Fixes #42431 and #42401 for 4.5.

Location:
branches/4.5
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.5

  • branches/4.5/src/wp-includes/wp-db.php

    r42060 r42233  
    18991899            $algo = function_exists( 'hash' ) ? 'sha256' : 'sha1';
    19001900            // Old WP installs may not have AUTH_SALT defined.
    1901             $salt = defined( 'AUTH_SALT' ) ? AUTH_SALT : rand();
     1901            $salt = defined( 'AUTH_SALT' ) && AUTH_SALT ? AUTH_SALT : (string) rand();
    19021902
    19031903            $placeholder = '{' . hash_hmac( $algo, uniqid( $salt, true ), $salt ) . '}';
Note: See TracChangeset for help on using the changeset viewer.