SILENT KILLERPanel

Current Path: > > usr > share > perl5 > URI


Operation   : Linux premium131.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
Software     : Apache
Server IP    : 162.0.232.56 | Your IP: 216.73.216.111
Domains      : 1034 Domain(s)
Permission   : [ 0755 ]

Files and Folders in: //usr/share/perl5/URI

NameTypeSizeLast ModifiedActions
file Directory - -
urn Directory - -
Escape.pm File 7061 bytes January 09 2018 06:42:55.
Heuristic.pm File 6524 bytes January 09 2018 06:42:55.
IRI.pm File 820 bytes January 09 2018 06:42:55.
QueryParam.pm File 4887 bytes January 09 2018 06:42:55.
Split.pm File 2379 bytes January 09 2018 06:42:55.
URL.pm File 5487 bytes January 09 2018 06:42:55.
WithBase.pm File 3857 bytes January 09 2018 06:42:55.
_foreign.pm File 133 bytes January 09 2018 06:42:55.
_generic.pm File 5848 bytes January 09 2018 06:42:55.
_idna.pm File 2105 bytes January 09 2018 06:42:55.
_ldap.pm File 3275 bytes January 09 2018 06:42:55.
_login.pm File 257 bytes January 09 2018 06:42:55.
_punycode.pm File 5648 bytes January 09 2018 06:42:55.
_query.pm File 2557 bytes January 09 2018 06:42:55.
_segment.pm File 442 bytes January 09 2018 06:42:55.
_server.pm File 3750 bytes January 09 2018 06:42:55.
_userpass.pm File 1060 bytes January 09 2018 06:42:55.
data.pm File 3417 bytes January 09 2018 06:42:55.
file.pm File 9761 bytes January 09 2018 06:42:55.
ftp.pm File 1082 bytes January 09 2018 06:42:55.
gopher.pm File 2454 bytes January 09 2018 06:42:55.
http.pm File 451 bytes January 09 2018 06:42:55.
https.pm File 170 bytes January 09 2018 06:42:55.
ldap.pm File 2950 bytes January 09 2018 06:42:55.
ldapi.pm File 467 bytes January 09 2018 06:42:55.
ldaps.pm File 170 bytes January 09 2018 06:42:55.
mailto.pm File 1302 bytes January 09 2018 06:42:55.
mms.pm File 151 bytes January 09 2018 06:42:55.
news.pm File 1480 bytes January 09 2018 06:42:55.
nntp.pm File 153 bytes January 09 2018 06:42:55.
pop.pm File 1233 bytes January 09 2018 06:42:55.
rlogin.pm File 155 bytes January 09 2018 06:42:55.
rsync.pm File 233 bytes January 09 2018 06:42:55.
rtsp.pm File 151 bytes January 09 2018 06:42:55.
rtspu.pm File 152 bytes January 09 2018 06:42:55.
sftp.pm File 124 bytes January 09 2018 06:42:55.
sip.pm File 1735 bytes January 09 2018 06:42:55.
sips.pm File 169 bytes January 09 2018 06:42:55.
snews.pm File 198 bytes January 09 2018 06:42:55.
ssh.pm File 201 bytes January 09 2018 06:42:55.
telnet.pm File 154 bytes January 09 2018 06:42:55.
tn3270.pm File 154 bytes January 09 2018 06:42:55.
urn.pm File 2201 bytes January 09 2018 06:42:55.

Reading File: //usr/share/perl5/URI/_server.pm

package URI::_server;

use strict;
use warnings;

use parent 'URI::_generic';

use URI::Escape qw(uri_unescape);

our $VERSION = '1.73';
$VERSION = eval $VERSION;

sub _uric_escape {
    my($class, $str) = @_;
    if ($str =~ m,^((?:$URI::scheme_re:)?)//([^/?\#]*)(.*)$,os) {
	my($scheme, $host, $rest) = ($1, $2, $3);
	my $ui = $host =~ s/(.*@)// ? $1 : "";
	my $port = $host =~ s/(:\d+)\z// ? $1 : "";
	if (_host_escape($host)) {
	    $str = "$scheme//$ui$host$port$rest";
	}
    }
    return $class->SUPER::_uric_escape($str);
}

sub _host_escape {
    return unless $_[0] =~ /[^$URI::uric]/;
    eval {
	require URI::_idna;
	$_[0] = URI::_idna::encode($_[0]);
    };
    return 0 if $@;
    return 1;
}

sub as_iri {
    my $self = shift;
    my $str = $self->SUPER::as_iri;
    if ($str =~ /\bxn--/) {
	if ($str =~ m,^((?:$URI::scheme_re:)?)//([^/?\#]*)(.*)$,os) {
	    my($scheme, $host, $rest) = ($1, $2, $3);
	    my $ui = $host =~ s/(.*@)// ? $1 : "";
	    my $port = $host =~ s/(:\d+)\z// ? $1 : "";
	    require URI::_idna;
	    $host = URI::_idna::decode($host);
	    $str = "$scheme//$ui$host$port$rest";
	}
    }
    return $str;
}

sub userinfo
{
    my $self = shift;
    my $old = $self->authority;

    if (@_) {
	my $new = $old;
	$new = "" unless defined $new;
	$new =~ s/.*@//;  # remove old stuff
	my $ui = shift;
	if (defined $ui) {
	    $ui =~ s/@/%40/g;   # protect @
	    $new = "$ui\@$new";
	}
	$self->authority($new);
    }
    return undef if !defined($old) || $old !~ /(.*)@/;
    return $1;
}

sub host
{
    my $self = shift;
    my $old = $self->authority;
    if (@_) {
	my $tmp = $old;
	$tmp = "" unless defined $tmp;
	my $ui = ($tmp =~ /(.*@)/) ? $1 : "";
	my $port = ($tmp =~ /(:\d+)$/) ? $1 : "";
	my $new = shift;
	$new = "" unless defined $new;
	if (length $new) {
	    $new =~ s/[@]/%40/g;   # protect @
	    if ($new =~ /^[^:]*:\d*\z/ || $new =~ /]:\d*\z/) {
		$new =~ s/(:\d*)\z// || die "Assert";
		$port = $1;
	    }
	    $new = "[$new]" if $new =~ /:/ && $new !~ /^\[/; # IPv6 address
	    _host_escape($new);
	}
	$self->authority("$ui$new$port");
    }
    return undef unless defined $old;
    $old =~ s/.*@//;
    $old =~ s/:\d+$//;          # remove the port
    $old =~ s{^\[(.*)\]$}{$1};  # remove brackets around IPv6 (RFC 3986 3.2.2)
    return uri_unescape($old);
}

sub ihost
{
    my $self = shift;
    my $old = $self->host(@_);
    if ($old =~ /(^|\.)xn--/) {
	require URI::_idna;
	$old = URI::_idna::decode($old);
    }
    return $old;
}

sub _port
{
    my $self = shift;
    my $old = $self->authority;
    if (@_) {
	my $new = $old;
	$new =~ s/:\d*$//;
	my $port = shift;
	$new .= ":$port" if defined $port;
	$self->authority($new);
    }
    return $1 if defined($old) && $old =~ /:(\d*)$/;
    return;
}

sub port
{
    my $self = shift;
    my $port = $self->_port(@_);
    $port = $self->default_port if !defined($port) || $port eq "";
    $port;
}

sub host_port
{
    my $self = shift;
    my $old = $self->authority;
    $self->host(shift) if @_;
    return undef unless defined $old;
    $old =~ s/.*@//;        # zap userinfo
    $old =~ s/:$//;         # empty port should be treated the same a no port
    $old .= ":" . $self->port unless $old =~ /:\d+$/;
    $old;
}


sub default_port { undef }

sub canonical
{
    my $self = shift;
    my $other = $self->SUPER::canonical;
    my $host = $other->host || "";
    my $port = $other->_port;
    my $uc_host = $host =~ /[A-Z]/;
    my $def_port = defined($port) && ($port eq "" ||
                                      $port == $self->default_port);
    if ($uc_host || $def_port) {
	$other = $other->clone if $other == $self;
	$other->host(lc $host) if $uc_host;
	$other->port(undef)    if $def_port;
    }
    $other;
}

1;

SILENT KILLER Tool