WordPress.org

Make WordPress Core

Changeset 42241


Ignore:
Timestamp:
11/27/2017 01:14:05 AM (6 months 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 3.7 branch.
Fixes #42431 and #42401 for 3.7.

Location:
branches/3.7
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/3.7

  • branches/3.7/src

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

    r42068 r42241  
    13951395            $algo = function_exists( 'hash' ) ? 'sha256' : 'sha1';
    13961396            // Old WP installs may not have AUTH_SALT defined.
    1397             $salt = defined( 'AUTH_SALT' ) ? AUTH_SALT : rand();
     1397            $salt = defined( 'AUTH_SALT' ) && AUTH_SALT ? AUTH_SALT : (string) rand();
    13981398
    13991399            $placeholder = '{' . hash_hmac( $algo, uniqid( $salt, true ), $salt ) . '}';
Note: See TracChangeset for help on using the changeset viewer.