From c848b5f670eb1dda22d08ef6befe912fc30d5345 Mon Sep 17 00:00:00 2001 From: Drew Jaynes Date: Sat, 19 Dec 2015 04:46:43 +0000 Subject: [PATCH] Docs: Add missing DocBlocks for `mb_substr()` and `_mb_substr()`. Both will be ignored from parsing as and serve as compat functions for PHP's `mb_substr()`, which is not enabled by default. Introduced in [17621]. See #32246. git-svn-id: https://develop.svn.wordpress.org/trunk@36017 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/compat.php | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/src/wp-includes/compat.php b/src/wp-includes/compat.php index 212ff8e332..69a5a7ce6c 100644 --- a/src/wp-includes/compat.php +++ b/src/wp-includes/compat.php @@ -42,15 +42,40 @@ function _wp_can_use_pcre_u( $set = null ) { } if ( ! function_exists( 'mb_substr' ) ) : + /** + * Compat function to mimic mb_substr(). + * + * @ignore + * @since 3.2.0 + * + * @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`. + * Default null. + * @param string|null $encoding Optional. Character encoding to use. Default null. + * @return string Extracted substring. + */ function mb_substr( $str, $start, $length = null, $encoding = null ) { return _mb_substr( $str, $start, $length, $encoding ); } endif; -/* +/** + * Internal compat function to mimic mb_substr(). + * * 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. + * + * @ignore + * @since 3.2.0 + * + * @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`. + * Default null. + * @param string|null $encoding Optional. Character encoding to use. Default null. + * @return string Extracted substring. */ function _mb_substr( $str, $start, $length = null, $encoding = null ) { if ( null === $encoding ) {