Only take away <lang> and 'source' from the pathinfo if something
actually follows after that. Otherwise we will just emit a confusing
error message. In doubt better interpret this as a search term.
Reported by Paul Wise.
push @components, 'index' if @components && $path =~ m,/$,;
my %LANGUAGES = map { $_ => 1 } @all_langs;
- if (@components > 0 and $LANGUAGES{$components[0]}
+ if (@components > 1 and $LANGUAGES{$components[0]}
and !$input->param('lang')) {
$input->param( 'lang', shift(@components) );
}
- if (@components > 0 and $components[0] eq 'source') {
+ if (@components > 1 and $components[0] eq 'source') {
shift @components;
$input->param( 'source', 1 );
}