Changeset 52039
- Timestamp:
- 11/08/2021 02:02:54 PM (3 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/compat.php
r52038 r52039 418 418 } 419 419 420 if ( ! function_exists( 'str_contains' ) ) { 421 /** 422 * Polyfill for `str_contains()` function added in PHP 8.0. 423 * 424 * Performs a case-sensitive check indicating if needle is 425 * contained in haystack. 426 * 427 * @since 5.9.0 428 * 429 * @param string $haystack The string to search in. 430 * @param string $needle The substring to search for in the haystack. 431 * @return bool True if `$needle` is in `$haystack`, otherwise false. 432 */ 433 function str_contains( $haystack, $needle ) { 434 return ( '' === $needle || false !== strpos( $haystack, $needle ) ); 435 } 436 } 437 420 438 // IMAGETYPE_WEBP constant is only defined in PHP 7.1 or later. 421 439 if ( ! defined( 'IMAGETYPE_WEBP' ) ) {
Note: See TracChangeset
for help on using the changeset viewer.