File tree Expand file tree Collapse file tree 2 files changed +3
-1
lines changed Expand file tree Collapse file tree 2 files changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ public static function sanitize(string $uri): string
1919 [
2020 '/\/(?<=\/)([A-F0-9]{8}-[A-F0-9]{4}-[A-F0-9]{4}-[A-F0-9]{4}-[A-F0-9]{12})(?=\/)?/i ' ,
2121 '/\/(?<=\/)([A-Z]{3}-?\d[0-9A-Z]\d{2})(?=\/)?/i ' ,
22- '/\/(?<=\/)[0-9A-F]{24}(?=\/)?/i ' ,
22+ '/\/(?<=\/)[0-9A-F]{16, 24}(?=\/)?/i ' ,
2323 '/\/(?<=\/)\d+(?=\/)?/ ' ,
2424 ],
2525 [
Original file line number Diff line number Diff line change @@ -68,6 +68,7 @@ public function testClearUriUuids(): void
6868 public function testClearUriOids (): void
6969 {
7070 $ oid = '650229807612bba4984d1fc7 ' ;
71+ $ oidShort = '65022612bba84d1f ' ;
7172
7273 self ::assertSame ('/v1/test ' , Uri::sanitize ('/v1/test ' ));
7374 self ::assertSame ('/v2/test/<OID> ' , Uri::sanitize ("/v2/test/ {$ oid }" ));
@@ -77,5 +78,6 @@ public function testClearUriOids(): void
7778 self ::assertSame ('/v6/test/<OID>/<OID>/ ' , Uri::sanitize ("/v6/test/ {$ oid }/ {$ oid }/ " ));
7879 self ::assertSame ('/v7/test/<OID>/<OID>/<OID> ' , Uri::sanitize ("/v7/test/ {$ oid }/ {$ oid }/ {$ oid }" ));
7980 self ::assertSame ('/v8/test/<OID>/<OID>/<OID>/ ' , Uri::sanitize ("/v8/test/ {$ oid }/ {$ oid }/ {$ oid }/ " ));
81+ self ::assertSame ('/v9/test/<OID>/bar/<NUMBER> ' , Uri::sanitize ("/v9/test/ {$ oidShort }/bar/12345 " ));
8082 }
8183}
You can’t perform that action at this time.
0 commit comments