From 16fa6a8405770e3f5b6ba014ad34138fce0ddb47 Mon Sep 17 00:00:00 2001 From: Frank Date: Fri, 16 Jan 2026 22:57:45 +0100 Subject: [PATCH] Verification done? Try many + 6 --- src/Tech/Service/EmailVerifier.php | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/Tech/Service/EmailVerifier.php b/src/Tech/Service/EmailVerifier.php index 0e4b086..aa3aef9 100644 --- a/src/Tech/Service/EmailVerifier.php +++ b/src/Tech/Service/EmailVerifier.php @@ -78,6 +78,21 @@ class EmailVerifier if (isset($parts['port'])) { $request->server->set('SERVER_PORT', $parts['port']); } + + // Force Request to re-calculate internal properties + $reflection = new \ReflectionObject($request); + foreach (['baseUrl', 'pathInfo', 'requestUri', 'method', 'format', 'session', 'locale', 'isHostValid', 'isForwardedValid'] as $propName) { + if ($reflection->hasProperty($propName)) { + $prop = $reflection->getProperty($propName); + $prop->setAccessible(true); + if ($propName === 'isHostValid' || $propName === 'isForwardedValid') { + $prop->setValue($request, true); + } else { + $prop->setValue($request, null); + } + } + } + if (isset($parts['path'])) { $baseUrl = rtrim($parts['path'], '/'); $request->server->set('SCRIPT_NAME', $baseUrl . '/index.php'); @@ -89,8 +104,7 @@ class EmailVerifier $request->server->set('REQUEST_URI', $baseUrl . $requestUri); } - // Force Request to re-calculate internal properties - $reflection = new \ReflectionObject($request); + // Force Request to re-calculate internal properties again after path changes foreach (['baseUrl', 'pathInfo', 'requestUri'] as $propName) { if ($reflection->hasProperty($propName)) { $prop = $reflection->getProperty($propName);