WordPress.org

Make WordPress Core


Ignore:
Timestamp:
09/23/2014 06:12:28 PM (7 years ago)
Author:
nacin
Message:

Add safeguards for when ext/hash is not compiled with PHP.

Merges [29751] to the 4.0 branch.

fixes #29518.

Location:
branches/4.0
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.0

  • branches/4.0/src/wp-includes/session.php

    r29635 r29761  
    6262     */
    6363    final private function hash_token( $token ) {
    64         return hash( 'sha256', $token );
     64        // If ext/hash is not present, use sha1() instead.
     65        if ( function_exists( 'hash' ) ) {
     66            return hash( 'sha256', $token );
     67        } else {
     68            return sha1( $token );
     69        }
    6570    }
    6671
Note: See TracChangeset for help on using the changeset viewer.