From f13ceb684658af9d8a08b7f658fe3974f0710b75 Mon Sep 17 00:00:00 2001 From: Shun Luk Date: Wed, 20 May 2026 11:49:49 +0200 Subject: [PATCH 1/2] Fix: fix issue on zorgsites where (password reset) url is created with first network site url instead of the current site --- src/URLFixer.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/URLFixer.php b/src/URLFixer.php index cd74c73..878eb88 100644 --- a/src/URLFixer.php +++ b/src/URLFixer.php @@ -4,6 +4,8 @@ namespace Yard\Bedrock; +use WP_Http; + /** * Class URLFixer * @@ -50,12 +52,15 @@ public function fixSiteURL(string $url): string } /** - * Ensure that the network site URL contains the /wp subdirectory. + * Ensure that the network site URL contains the /wp subdirectory and uses the current request host. */ public function fixNetworkSiteURL(string $url, string $path): string { $path = ltrim($path, '/'); - $url = substr($url, 0, strlen($url) - strlen($path)); + + $scheme = is_ssl() ? 'https' : 'http'; + $host = $_SERVER['HTTP_HOST'] ?? parse_url($url, PHP_URL_HOST); + $url = $scheme . '://' . $host . '/'; if (substr($url, -3) !== 'wp/') { $url .= 'wp/'; From 30d9d04fb4ffd54f58f999530fb46b14706fdee7 Mon Sep 17 00:00:00 2001 From: Yard workflows Date: Wed, 20 May 2026 09:55:36 +0000 Subject: [PATCH 2/2] style: apply php-cs-fixer changes --- src/URLFixer.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/URLFixer.php b/src/URLFixer.php index 878eb88..85a0b48 100644 --- a/src/URLFixer.php +++ b/src/URLFixer.php @@ -4,8 +4,6 @@ namespace Yard\Bedrock; -use WP_Http; - /** * Class URLFixer *