From f0675aeb4cc30c44a2f62d8f9c705ddd84fbdb48 Mon Sep 17 00:00:00 2001 From: Frank Lichtenheld Date: Tue, 30 Oct 2007 00:43:30 +0100 Subject: [PATCH] Packages::Dispatcher: Fix parsing error of pathinfo Only take away 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. --- lib/Packages/Dispatcher.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Packages/Dispatcher.pm b/lib/Packages/Dispatcher.pm index ff68426..4da8c56 100755 --- a/lib/Packages/Dispatcher.pm +++ b/lib/Packages/Dispatcher.pm @@ -147,11 +147,11 @@ sub do_dispatch { 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 ); } -- 2.39.2