From 479c9fff692de7ff2ae6b265e232afa2084615b0 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Fri, 31 Jul 2020 15:15:39 +0200 Subject: [PATCH] don't parse uris without {} elements --- Uri/UriFactory.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Uri/UriFactory.php b/Uri/UriFactory.php index db44ed29f..e463cce77 100644 --- a/Uri/UriFactory.php +++ b/Uri/UriFactory.php @@ -248,6 +248,10 @@ final class UriFactory */ public static function build(string $uri, array $toMatch = []) : string { + if (\stripos($uri, '{') === false) { + return $uri; + } + $parsed = \preg_replace_callback('(\{[\/#\?%@\.\$][a-zA-Z0-9\-]*\})', function ($match) use ($toMatch) { $match = \substr($match[0], 1, \strlen($match[0]) - 2);