From a2f067920cab34e1ba8d9d71c922c1d286b66bab Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Sat, 19 Mar 2022 00:02:44 +0100 Subject: [PATCH] bug fixes from the day before --- Uri/UriFactory.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Uri/UriFactory.php b/Uri/UriFactory.php index 98beccec3..3bc48cb10 100644 --- a/Uri/UriFactory.php +++ b/Uri/UriFactory.php @@ -288,7 +288,13 @@ final class UriFactory $parsed = \preg_replace_callback('(\{[\/#\?%@\.\$][a-zA-Z0-9\-]*\})', function ($match) use ($toMatch) { $match = \substr($match[0], 1, \strlen($match[0]) - 2); - return $toMatch[$match] ?? self::$uri[$match] ?? '---'; + return $toMatch[$match] + ?? (self::$uri[$match] ?? ( + ($match[0] ?? '') === '?' + ? '---' // only do this for query parameters + : '' + ) + ); }, $uri); return self::unique($parsed ?? '');