From decb25a8ae43d39852f8f86575cd54612cf80b59 Mon Sep 17 00:00:00 2001 From: Drew Jaynes Date: Sat, 19 Dec 2015 05:11:27 +0000 Subject: [PATCH] Docs: Add missing DocBlocks for `hash_hmac()` and `_hash_hmac()`. Both will be ignored from parsing as and serve as compat functions for PHP's `hash_hmac()`. Introduced in [18111]. See #32246. Built from https://develop.svn.wordpress.org/trunk@36021 git-svn-id: http://core.svn.wordpress.org/trunk@35986 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/compat.php | 30 ++++++++++++++++++++++++++++++ wp-includes/version.php | 2 +- 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/wp-includes/compat.php b/wp-includes/compat.php index 6755b5e557..14b5fd2155 100644 --- a/wp-includes/compat.php +++ b/wp-includes/compat.php @@ -217,11 +217,41 @@ function _mb_strlen( $str, $encoding = null ) { } if ( !function_exists('hash_hmac') ): +/** + * Compat function to mimic hash_hmac(). + * + * @ignore + * @since 3.2.0 + * + * @see _hash_hmac() + * + * @param string $algo Hash algorithm. Accepts 'md5' or 'sha1'. + * @param string $data Data to be hashed. + * @param string $key Secret key to use for generating the hash. + * @param bool $raw_output Optional. Whether to output raw binary data (true), + * or lowercase hexits (false). Default false. + * @return string|false The hash in output determined by `$raw_output`. False if `$algo` + * is unknown or invalid. + */ function hash_hmac($algo, $data, $key, $raw_output = false) { return _hash_hmac($algo, $data, $key, $raw_output); } endif; +/** + * Internal compat function to mimic hash_hmac(). + * + * @ignore + * @since 3.2.0 + * + * @param string $algo Hash algorithm. Accepts 'md5' or 'sha1'. + * @param string $data Data to be hashed. + * @param string $key Secret key to use for generating the hash. + * @param bool $raw_output Optional. Whether to output raw binary data (true), + * or lowercase hexits (false). Default false. + * @return string|false The hash in output determined by `$raw_output`. False if `$algo` + * is unknown or invalid. + */ function _hash_hmac($algo, $data, $key, $raw_output = false) { $packs = array('md5' => 'H32', 'sha1' => 'H40'); diff --git a/wp-includes/version.php b/wp-includes/version.php index d74fc70418..9db5261aab 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.5-alpha-36020'; +$wp_version = '4.5-alpha-36021'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.