Skip to content

Commit 7241968

Browse files
more comments for assert_uri_reference()
1 parent c0b1d6d commit 7241968

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib/JSON/Schema/Modern/Utilities.pm

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -422,11 +422,11 @@ sub assert_uri_reference ($state, $schema) {
422422
return E($state, '%s value is not a valid URI reference', $state->{keyword})
423423
# see also uri-reference format sub
424424
if fc(Mojo::URL->new($string)->to_unsafe_string) ne fc($string)
425-
or $string =~ /[^[:ascii:]]/
426-
or $string =~ /#/
427-
and $string !~ m{#$} # empty fragment
428-
and $string !~ m{#[A-Za-z][A-Za-z0-9_:.-]*$} # plain-name fragment
429-
and $string !~ m{#/(?:[^~]|~[01])*$}; # json pointer fragment
425+
or $string =~ /[^[:ascii:]]/ # ascii characters only
426+
or $string =~ /#/ # no fragment, except...
427+
and $string !~ m{#$} # allow empty fragment
428+
and $string !~ m{#[A-Za-z][A-Za-z0-9_:.-]*$} # allow plain-name fragment
429+
and $string !~ m{#/(?:[^~]|~[01])*$}; # allow json pointer fragment
430430

431431
return 1;
432432
}

0 commit comments

Comments
 (0)