File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1162,4 +1162,17 @@ mod tests {
11621162 use crate :: canonicalize_and_process:: canonicalize_pathname;
11631163 assert ! ( canonicalize_pathname( "3�/.." ) . is_ok( ) ) ;
11641164 }
1165+
1166+ #[ test]
1167+ fn matcher_matches_doesnt_crash ( ) {
1168+ let input = "(H\\ PH)e:*) (emH\\ <N)E*(elNH\\ PH)e�{}?u" ;
1169+ let base = "example.com" ;
1170+ let base_url = Url :: parse ( base) . ok ( ) ;
1171+ let init =
1172+ UrlPatternInit :: parse_constructor_string :: < regex:: Regex > ( input, base_url) ;
1173+ let options = None ;
1174+ let _ = init. and_then ( |init_res| {
1175+ UrlPattern :: < Regex > :: parse ( init_res, options. unwrap_or_default ( ) )
1176+ } ) ;
1177+ }
11651178}
Original file line number Diff line number Diff line change @@ -94,7 +94,7 @@ impl<R: RegExp> Matcher<R> {
9494 Some ( vec ! [ Some ( input) ] )
9595 }
9696 InnerMatcher :: RegExp { regexp, .. } => {
97- regexp. as_ref ( ) . unwrap ( ) . matches ( input)
97+ regexp. as_ref ( ) . ok ( ) ? . matches ( input)
9898 }
9999 }
100100 }
You can’t perform that action at this time.
0 commit comments