Changeset 60950 for trunk/src/wp-includes/compat.php
- Timestamp:
- 10/16/2025 11:17:14 PM (12 months ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/compat.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/compat.php
r60949 r60950 248 248 } 249 249 250 if ( ! function_exists( 'utf8_encode' ) ) : 251 if ( extension_loaded( 'mbstring' ) ) : 252 /** 253 * Converts a string from ISO-8859-1 to UTF-8. 254 * 255 * @deprecated Use {@see \mb_convert_encoding()} instead. 256 * 257 * @since 6.9.0 258 * 259 * @param string $iso_8859_1_text Text treated as ISO-8859-1 (latin1) bytes. 260 * @return string Text converted into a UTF-8. 261 */ 262 function utf8_encode( $iso_8859_1_text ): string { 263 _deprecated_function( __FUNCTION__, '6.9.0', 'mb_convert_encoding' ); 264 265 return mb_convert_encoding( $iso_8859_1_text, 'UTF-8', 'ISO-8859-1' ); 266 } 267 268 else : 269 /** 270 * @ignore 271 * @private 272 * 273 * @since 6.9.0 274 */ 275 function utf8_encode( $iso_8859_1_text ): string { 276 _deprecated_function( __FUNCTION__, '6.9.0', 'mb_convert_encoding' ); 277 278 return _wp_utf8_encode_fallback( $iso_8859_1_text ); 279 } 280 281 endif; 282 endif; 283 284 if ( ! function_exists( 'utf8_decode' ) ) : 285 if ( extension_loaded( 'mbstring' ) ) : 286 /** 287 * Converts a string from UTF-8 to ISO-8859-1. 288 * 289 * @deprecated Use {@see \mb_convert_encoding()} instead. 290 * 291 * @since 6.9.0 292 * 293 * @param string $utf8_text Text treated as UTF-8. 294 * @return string Text converted into ISO-8859-1. 295 */ 296 function utf8_decode( $utf8_text ): string { 297 _deprecated_function( __FUNCTION__, '6.9.0', 'mb_convert_encoding' ); 298 299 return mb_convert_encoding( $utf8_text, 'ISO-8859-1', 'UTF-8' ); 300 } 301 302 else : 303 /** 304 * @ignore 305 * @private 306 * 307 * @since 6.9.0 308 */ 309 function utf8_decode( $utf8_text ): string { 310 _deprecated_function( __FUNCTION__, '6.9.0', 'mb_convert_encoding' ); 311 312 return _wp_utf8_decode_fallback( $utf8_text ); 313 } 314 315 endif; 316 endif; 317 250 318 // sodium_crypto_box() was introduced in PHP 7.2. 251 319 if ( ! function_exists( 'sodium_crypto_box' ) ) {
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)