diff --git a/wp-cache-phase2.php b/wp-cache-phase2.php index 0cb613de..a968fb8b 100644 --- a/wp-cache-phase2.php +++ b/wp-cache-phase2.php @@ -854,8 +854,9 @@ function get_current_url_supercache_dir( $post_id = 0 ) { } } else { $uri = str_replace( $site_url, '', $permalink ); - if ( ! str_starts_with( $uri, $wp_cache_home_path ) ) { - $uri = rtrim( $wp_cache_home_path, '/' ) . $uri; + $home_path = $wp_cache_home_path ?? ''; + if ( $home_path !== '' && ! str_starts_with( $uri, $home_path ) ) { + $uri = rtrim( $home_path, '/' ) . $uri; } } } else {