WordPress.org

Make WordPress Core

Changeset 36017


Ignore:
Timestamp:
12/19/2015 04:46:43 AM (4 years ago)
Author:
DrewAPicture
Message:

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.

File:
1 edited

Legend:

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

    r35805 r36017  
    4343
    4444if ( ! function_exists( 'mb_substr' ) ) :
     45    /**
     46     * Compat function to mimic mb_substr().
     47     *
     48     * @ignore
     49     * @since 3.2.0
     50     *
     51     * @param string      $str      The string to extract the substring from.
     52     * @param int         $start    Position to being extraction from in `$str`.
     53     * @param int|null    $length   Optional. Maximum number of characters to extract from `$str`.
     54     *                              Default null.
     55     * @param string|null $encoding Optional. Character encoding to use. Default null.
     56     * @return string Extracted substring.
     57     */
    4558    function mb_substr( $str, $start, $length = null, $encoding = null ) {
    4659        return _mb_substr( $str, $start, $length, $encoding );
     
    4861endif;
    4962
    50 /*
     63/**
     64 * Internal compat function to mimic mb_substr().
     65 *
    5166 * Only understands UTF-8 and 8bit.  All other character sets will be treated as 8bit.
    5267 * For $encoding === UTF-8, the $str input is expected to be a valid UTF-8 byte sequence.
    5368 * The behavior of this function for invalid inputs is undefined.
     69 *
     70 * @ignore
     71 * @since 3.2.0
     72 *
     73 * @param string      $str      The string to extract the substring from.
     74 * @param int         $start    Position to being extraction from in `$str`.
     75 * @param int|null    $length   Optional. Maximum number of characters to extract from `$str`.
     76 *                              Default null.
     77 * @param string|null $encoding Optional. Character encoding to use. Default null.
     78 * @return string Extracted substring.
    5479 */
    5580function _mb_substr( $str, $start, $length = null, $encoding = null ) {
Note: See TracChangeset for help on using the changeset viewer.