wp/wp-includes/compat.php
changeset 18 be944660c56a
parent 16 a86126ab1dd4
child 19 3d72ae0968f4
--- a/wp/wp-includes/compat.php	Tue Dec 15 15:52:01 2020 +0100
+++ b/wp/wp-includes/compat.php	Wed Sep 21 18:19:35 2022 +0200
@@ -127,7 +127,7 @@
 		// If there's anything left over, repeat the loop.
 	} while ( count( $pieces ) > 1 && $str = array_pop( $pieces ) );
 
-	return join( '', array_slice( $chars, $start, $length ) );
+	return implode( '', array_slice( $chars, $start, $length ) );
 }
 
 if ( ! function_exists( 'mb_strlen' ) ) :
@@ -370,3 +370,13 @@
 		return ( is_array( $var ) || $var instanceof Traversable );
 	}
 }
+
+// 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 ); // phpcs:ignore PHPCompatibility.Constants.NewConstants.imagetype_webpFound
+}