use HTML::Entities;
use HTTP::Body;
use HTTP::Headers;
-use URI::Escape ();
use URI::QueryParam;
use Scalar::Util ();
sub prepare_query_parameters {
my ( $self, $c, $query_string ) = @_;
- # Make sure query has params
+ # Check for keywords (no = signs)
+ # (yes, index() is faster than a regex :))
if ( index( $query_string, '=' ) < 0 ) {
+ $c->request->query_keywords( $self->unescape_uri($query_string) );
return;
}
=cut
sub unescape_uri {
- my $self = shift;
+ my ( $self, $str ) = @_;
- my $e = URI::Escape::uri_unescape(@_);
- $e =~ s/\+/ /g;
+ $str =~ s/%([0-9A-Fa-f]{2})/chr(hex($1))/eg;
+ $str =~ s/\+/ /g;
- return $e;
+ return $str;
}
=head2 $self->finalize_output