Fix deprecated error message for LYS in PHP 8.1 environment (#46661)
* Fix deprecated error with strlen when using PHP 8.1 * Changelog
This commit is contained in:
parent
9e0fab4ebc
commit
d2c4490c92
|
@ -0,0 +1,4 @@
|
|||
Significance: patch
|
||||
Type: fix
|
||||
|
||||
Fix deprecated error message with strlen usage in PHP 8.1
|
|
@ -236,7 +236,7 @@ class WCAdminHelper {
|
|||
private static function get_normalized_url_path( $url ) {
|
||||
$query = wp_parse_url( $url, PHP_URL_QUERY );
|
||||
$path = wp_parse_url( $url, PHP_URL_PATH ) . ( $query ? '?' . $query : '' );
|
||||
$home_path = wp_parse_url( site_url(), PHP_URL_PATH );
|
||||
$home_path = wp_parse_url( site_url(), PHP_URL_PATH ) ?? '';
|
||||
$normalized_path = trim( substr( $path, strlen( $home_path ) ), '/' );
|
||||
return $normalized_path;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue