wp core update 6.6
This commit is contained in:
@@ -91,7 +91,7 @@ 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().
|
||||
*/
|
||||
if ( ! in_array( $encoding, array( 'utf8', 'utf-8', 'UTF8', 'UTF-8' ), true ) ) {
|
||||
if ( ! is_utf8_charset( $encoding ) ) {
|
||||
return is_null( $length ) ? substr( $str, $start ) : substr( $str, $start, $length );
|
||||
}
|
||||
|
||||
@@ -176,7 +176,7 @@ function _mb_strlen( $str, $encoding = null ) {
|
||||
* The solution below works only for UTF-8, so in case of a different charset
|
||||
* just use built-in strlen().
|
||||
*/
|
||||
if ( ! in_array( $encoding, array( 'utf8', 'utf-8', 'UTF8', 'UTF-8' ), true ) ) {
|
||||
if ( ! is_utf8_charset( $encoding ) ) {
|
||||
return strlen( $str );
|
||||
}
|
||||
|
||||
@@ -359,23 +359,6 @@ if ( ! function_exists( 'is_countable' ) ) {
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'is_iterable' ) ) {
|
||||
/**
|
||||
* Polyfill for is_iterable() function added in PHP 7.1.
|
||||
*
|
||||
* Verify that the content of a variable is an array or an object
|
||||
* implementing the Traversable interface.
|
||||
*
|
||||
* @since 4.9.6
|
||||
*
|
||||
* @param mixed $value The value to check.
|
||||
* @return bool True if `$value` is iterable, false otherwise.
|
||||
*/
|
||||
function is_iterable( $value ) {
|
||||
return ( is_array( $value ) || $value instanceof Traversable );
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'array_key_first' ) ) {
|
||||
/**
|
||||
* Polyfill for array_key_first() function added in PHP 7.3.
|
||||
@@ -520,16 +503,6 @@ if ( ! function_exists( 'str_ends_with' ) ) {
|
||||
}
|
||||
}
|
||||
|
||||
// IMAGETYPE_WEBP constant is only defined in PHP 7.1 or later.
|
||||
if ( ! defined( 'IMAGETYPE_WEBP' ) ) {
|
||||
define( 'IMAGETYPE_WEBP', 18 );
|
||||
}
|
||||
|
||||
// IMG_WEBP constant is only defined in PHP 7.0.10 or later.
|
||||
if ( ! defined( 'IMG_WEBP' ) ) {
|
||||
define( 'IMG_WEBP', IMAGETYPE_WEBP );
|
||||
}
|
||||
|
||||
// IMAGETYPE_AVIF constant is only defined in PHP 8.x or later.
|
||||
if ( ! defined( 'IMAGETYPE_AVIF' ) ) {
|
||||
define( 'IMAGETYPE_AVIF', 19 );
|
||||
|
||||
Reference in New Issue
Block a user