From e7447543891a429dd0c1541ad96cb154eb44f1a6 Mon Sep 17 00:00:00 2001 From: Keith Solomon Date: Sun, 26 Apr 2026 14:45:17 -0500 Subject: [PATCH] fix: avoid userinfo url rewrites --- src/Url/UrlTransformer.php | 2 +- tests/Unit/Url/UrlTransformerTest.php | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/Url/UrlTransformer.php b/src/Url/UrlTransformer.php index 23e77ce..c64cdce 100644 --- a/src/Url/UrlTransformer.php +++ b/src/Url/UrlTransformer.php @@ -56,7 +56,7 @@ final class UrlTransformer { $sources ); - return '~(?transformString( + 'https://example.test@evil.test/path https://example.test/path', + $mappings + ) + ); + } + public function test_it_prefers_more_specific_overlapping_mappings(): void { $transformer = new UrlTransformer(); $mappings = new UrlMappingCollection(