CGI-Info

 view release on metacpan or  search on metacpan

lib/CGI/Info.pm  view on Meta::CPAN

	if($params) {
		return Return::Set::set_return($params->{$field}, { type => 'string' });
	}
}

sub _sanitise_input :Protected {
	my $arg = shift;

	# Protected function: inline check because the ($) prototype means no $self,
	unless($ENV{HARNESS_ACTIVE}) {
		my $calling_pkg = (caller)[0];
		unless($calling_pkg && ($calling_pkg eq __PACKAGE__ || $calling_pkg->isa(__PACKAGE__))) {
			Carp::croak('_sanitise_input() is a protected function and cannot be called from outside ' . __PACKAGE__);
		}
	}

	return if(!defined($arg));

	# Remove hacking attempts and spaces
	$arg =~ s/[\r\n]//g;
	$arg =~ s/\s+$//;

lib/CGI/Info.pm  view on Meta::CPAN


	# Skip if called on destruction
	return if($method eq 'DESTROY');

	Carp::croak(__PACKAGE__, ": Unknown method $method") if(!ref($self));

	# Allow the AUTOLOAD feature to be disabled
	Carp::croak(__PACKAGE__, ": Unknown method $method") if(exists($self->{'auto_load'}) && boolean($self->{'auto_load'})->isFalse());

	# Ensure the method is called on the correct package object or a subclass
	return unless((ref($self) eq __PACKAGE__) || (UNIVERSAL::isa((caller)[0], __PACKAGE__)));

	# Validate method name - only allow safe parameter names
	Carp::croak(__PACKAGE__, ": Invalid method name: $method") unless $method =~ /^[a-zA-Z_][a-zA-Z0-9_]*$/;

	# Delegate to the param method
	return $self->param($method);
}

=head1 AUTHOR



( run in 1.270 second using v1.01-cache-2.11-cpan-6de40a662fe )