Edit File by line
/home/zeestwma/richards.../wp-inclu...
File: compat.php
* Performs a case-sensitive check indicating if
[500] Fix | Delete
* the haystack begins with needle.
[501] Fix | Delete
*
[502] Fix | Delete
* @since 5.9.0
[503] Fix | Delete
*
[504] Fix | Delete
* @param string $haystack The string to search in.
[505] Fix | Delete
* @param string $needle The substring to search for in the `$haystack`.
[506] Fix | Delete
* @return bool True if `$haystack` starts with `$needle`, otherwise false.
[507] Fix | Delete
*/
[508] Fix | Delete
function str_starts_with( $haystack, $needle ) {
[509] Fix | Delete
if ( '' === $needle ) {
[510] Fix | Delete
return true;
[511] Fix | Delete
}
[512] Fix | Delete
[513] Fix | Delete
return 0 === strpos( $haystack, $needle );
[514] Fix | Delete
}
[515] Fix | Delete
}
[516] Fix | Delete
[517] Fix | Delete
if ( ! function_exists( 'str_ends_with' ) ) {
[518] Fix | Delete
/**
[519] Fix | Delete
* Polyfill for `str_ends_with()` function added in PHP 8.0.
[520] Fix | Delete
*
[521] Fix | Delete
* Performs a case-sensitive check indicating if
[522] Fix | Delete
* the haystack ends with needle.
[523] Fix | Delete
*
[524] Fix | Delete
* @since 5.9.0
[525] Fix | Delete
*
[526] Fix | Delete
* @param string $haystack The string to search in.
[527] Fix | Delete
* @param string $needle The substring to search for in the `$haystack`.
[528] Fix | Delete
* @return bool True if `$haystack` ends with `$needle`, otherwise false.
[529] Fix | Delete
*/
[530] Fix | Delete
function str_ends_with( $haystack, $needle ) {
[531] Fix | Delete
if ( '' === $haystack ) {
[532] Fix | Delete
return '' === $needle;
[533] Fix | Delete
}
[534] Fix | Delete
[535] Fix | Delete
$len = strlen( $needle );
[536] Fix | Delete
[537] Fix | Delete
return substr( $haystack, -$len, $len ) === $needle;
[538] Fix | Delete
}
[539] Fix | Delete
}
[540] Fix | Delete
[541] Fix | Delete
// IMAGETYPE_AVIF constant is only defined in PHP 8.x or later.
[542] Fix | Delete
if ( ! defined( 'IMAGETYPE_AVIF' ) ) {
[543] Fix | Delete
define( 'IMAGETYPE_AVIF', 19 );
[544] Fix | Delete
}
[545] Fix | Delete
[546] Fix | Delete
// IMG_AVIF constant is only defined in PHP 8.x or later.
[547] Fix | Delete
if ( ! defined( 'IMG_AVIF' ) ) {
[548] Fix | Delete
define( 'IMG_AVIF', IMAGETYPE_AVIF );
[549] Fix | Delete
}
[550] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function