Compare commits
2 Commits
4d48f90ceb
...
1826f7e847
| Author | SHA1 | Date | |
|---|---|---|---|
| 1826f7e847 | |||
| 86007a74d8 |
@@ -58,6 +58,7 @@ sub sanitize_url {
|
|||||||
return undef if $authority =~ /[\s\x00-\x1F\x7F]/;
|
return undef if $authority =~ /[\s\x00-\x1F\x7F]/;
|
||||||
|
|
||||||
my $hostport = ( split /\@/, $authority )[-1];
|
my $hostport = ( split /\@/, $authority )[-1];
|
||||||
|
return undef unless defined $hostport && length $hostport;
|
||||||
my $host_raw;
|
my $host_raw;
|
||||||
if ( $hostport =~ /^\[(.+)\](?::\d+)?$/ ) {
|
if ( $hostport =~ /^\[(.+)\](?::\d+)?$/ ) {
|
||||||
$host_raw = $1;
|
$host_raw = $1;
|
||||||
|
|||||||
@@ -71,6 +71,7 @@ sub is_valid_url_length {
|
|||||||
|
|
||||||
sub _is_valid_ipv4 {
|
sub _is_valid_ipv4 {
|
||||||
my ( $self, $ip ) = @_;
|
my ( $self, $ip ) = @_;
|
||||||
|
return 0 unless defined $ip;
|
||||||
return 0 unless $ip =~ /^(\d+)\.(\d+)\.(\d+)\.(\d+)$/;
|
return 0 unless $ip =~ /^(\d+)\.(\d+)\.(\d+)\.(\d+)$/;
|
||||||
my ( $a, $b, $c, $d ) = ( $1, $2, $3, $4 );
|
my ( $a, $b, $c, $d ) = ( $1, $2, $3, $4 );
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user