Add compat for mb_substr rather than mb_strcut. fixes #9055

git-svn-id: https://develop.svn.wordpress.org/trunk@10707 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2009-03-04 22:05:49 +00:00
parent e38f8c8c94
commit b5d7564f50
1 changed files with 4 additions and 4 deletions

View File

@ -77,13 +77,13 @@ function hash_hmac($algo, $data, $key, $raw_output = false) {
}
endif;
if ( ! function_exists('mb_strcut') ):
function mb_strcut( $str, $start, $length=null, $encoding=null ) {
return _mb_strcut($str, $start, $length, $encoding);
if ( ! function_exists('mb_substr') ):
function mb_substr( $str, $start, $length=null, $encoding=null ) {
return _mb_substr($str, $start, $length, $encoding);
}
endif;
function _mb_strcut( $str, $start, $length=null, $encoding=null ) {
function _mb_substr( $str, $start, $length=null, $encoding=null ) {
// the solution below, works only for utf-8, so in case of a different
// charset, just use built-in substr
$charset = get_option( 'blog_charset' );