From 87786b43737708fdb0746095f4a04ab816c76d3b Mon Sep 17 00:00:00 2001 From: Drew Jaynes Date: Sat, 19 Dec 2015 04:56:29 +0000 Subject: [PATCH] Docs: Add missing DocBlocks for `mb_strlen()` and `_mb_strlen()`. Both will be ignored from parsing as and serve as compat functions for PHP's `mb_strlen()`, which is not enabled by default. Introduced in [32114]. See #32246. Built from https://develop.svn.wordpress.org/trunk@36019 git-svn-id: http://core.svn.wordpress.org/trunk@35984 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/compat.php | 29 ++++++++++++++++++++++++++--- wp-includes/version.php | 2 +- 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/wp-includes/compat.php b/wp-includes/compat.php index c097ca307a..3a71db17c7 100644 --- a/wp-includes/compat.php +++ b/wp-includes/compat.php @@ -48,6 +48,8 @@ if ( ! function_exists( 'mb_substr' ) ) : * @ignore * @since 3.2.0 * + * @see _mb_substr() + * * @param string $str The string to extract the substring from. * @param int $start Position to being extraction from in `$str`. * @param int|null $length Optional. Maximum number of characters to extract from `$str`. @@ -130,15 +132,36 @@ function _mb_substr( $str, $start, $length = null, $encoding = null ) { } if ( ! function_exists( 'mb_strlen' ) ) : + /** + * Compat function to mimic mb_strlen(). + * + * @ignore + * @since 4.2.0 + * + * @see _mb_strlen() + * + * @param string $str The string to retrieve the character length from. + * @param string|null $encoding Optional. Character encoding to use. Default null. + * @return int String length of `$str`. + */ function mb_strlen( $str, $encoding = null ) { return _mb_strlen( $str, $encoding ); } endif; -/* +/** + * Internal compat function to mimic mb_strlen(). + * * Only understands UTF-8 and 8bit. All other character sets will be treated as 8bit. - * For $encoding === UTF-8, the $str input is expected to be a valid UTF-8 byte sequence. - * The behavior of this function for invalid inputs is undefined. + * For $encoding === UTF-8, the `$str` input is expected to be a valid UTF-8 byte + * sequence. The behavior of this function for invalid inputs is undefined. + * + * @ignore + * @since 4.2.0 + * + * @param string $str The string to retrieve the character length from. + * @param string|null $encoding Optional. Character encoding to use. Default null. + * @return int String length of `$str`. */ function _mb_strlen( $str, $encoding = null ) { if ( null === $encoding ) { diff --git a/wp-includes/version.php b/wp-includes/version.php index 3d7eff17b4..3c7b562e2c 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.5-alpha-36018'; +$wp_version = '4.5-alpha-36019'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.