Make WordPress Core

Ticket #32778: 32778.patch

File 32778.patch, 747 bytes (added by AramZS, 11 years ago)

Clarifying hash_equals in a way consistent with PHP docs.

  • wp-includes/compat.php

     
    228228
    229229if ( ! function_exists( 'hash_equals' ) ) :
    230230/**
    231  * Compare two strings in constant time.
     231 * Timing attack safe string comparison
    232232 *
    233233 * This function was added in PHP 5.6.
    234  * It can leak the length of a string.
     234 * It can leak the length of a string when arguments of differing length are supplied.
    235235 *
    236236 * @since 3.9.2
    237237 *
    238238 * @param string $a Expected string.
    239  * @param string $b Actual string.
     239 * @param string $b Actual, user supplied, string.
    240240 * @return bool Whether strings are equal.
    241241 */
    242242function hash_equals( $a, $b ) {