WordPress.org

Make WordPress Core

Changeset 45638


Ignore:
Timestamp:
07/15/2019 05:13:10 AM (19 months ago)
Author:
pento
Message:

Code Modernisation: Document when the Hash polyfills can be removed.

The Hash extension cannot be disabled as of PHP 7.4. So, while we can't remove these polyfills yet, we can document when we'll be able to.

Props jrf.
Fixes #47698.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/compat.php

    r45637 r45638  
    221221    /**
    222222     * Compat function to mimic hash_hmac().
     223     *
     224     * The Hash extension is bundled with PHP by default since PHP 5.1.2.
     225     * However, the extension may be explicitly disabled on select servers.
     226     * As of PHP 7.4.0, the Hash extension is a core PHP extension and can no
     227     * longer be disabled.
     228     * I.e. when PHP 7.4.0 becomes the minimum requirement, this polyfill
     229     * and the associated `_hash_hmac()` function can be safely removed.
    223230     *
    224231     * @ignore
     
    336343     * Compares two strings using the same time whether they're equal or not.
    337344     *
     345     * Note: It can leak the length of a string when arguments of differing length are supplied.
     346     *
    338347     * This function was added in PHP 5.6.
    339      *
    340      * Note: It can leak the length of a string when arguments of differing length are supplied.
     348     * However, the Hash extension may be explicitly disabled on select servers.
     349     * As of PHP 7.4.0, the Hash extension is a core PHP extension and can no
     350     * longer be disabled.
     351     * I.e. when PHP 7.4.0 becomes the minimum requirement, this polyfill
     352     * can be safely removed.
    341353     *
    342354     * @since 3.9.2
Note: See TracChangeset for help on using the changeset viewer.