don't parse uris without {} elements

This commit is contained in:
Dennis Eichhorn 2020-07-31 15:15:39 +02:00
parent 568f3fab4b
commit 479c9fff69

View File

@ -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);