summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2009-07-04 20:25:05 +0200
committerYorhel <git@yorhel.nl>2009-07-04 20:25:05 +0200
commit4484e5eea0632f4a29f20e997ae7007d7ff2726f (patch)
tree6b65afbbd8e521e5343965ae7e5c63121db0c0cd /lib
parenteb5cf4b60da8916b9fa480b3e48a91116f52b96f (diff)
Re-added language parsing in VN search box
Because many people still link to things like /v/all?q=English. Platform searches are less common, so I doubt many people care about URL compatibility for that,
Diffstat (limited to 'lib')
-rw-r--r--lib/VNDB/Handler/VNBrowse.pm11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/VNDB/Handler/VNBrowse.pm b/lib/VNDB/Handler/VNBrowse.pm
index db42db81..1e02337d 100644
--- a/lib/VNDB/Handler/VNBrowse.pm
+++ b/lib/VNDB/Handler/VNBrowse.pm
@@ -27,8 +27,15 @@ sub list {
return 404 if $f->{_err};
$f->{q} ||= $f->{sq};
- return $self->resRedirect('/'.$1.$2.(!$3 ? '' : $1 eq 'd' ? '#'.$3 : '.'.$3), 'temp')
- if $f->{q} && $f->{q} =~ /^([gvrptud])([0-9]+)(?:\.([0-9]+))?$/;
+ if($f->{q}) {
+ return $self->resRedirect('/'.$1.$2.(!$3 ? '' : $1 eq 'd' ? '#'.$3 : '.'.$3), 'temp')
+ if $f->{q} =~ /^([gvrptud])([0-9]+)(?:\.([0-9]+))?$/;
+
+ # for URL compatibilty with older versions
+ my @lang;
+ $f->{q} =~ s/\s*$self->{languages}{$_}\s*//&&push @lang, $_ for (keys %{$self->{languages}});
+ $f->{ln} = $f->{ln}[0] ? [ @{$f->{ln}}, @lang ] : \@lang;
+ }
my($list, $np) = $self->dbVNGet(
$char ne 'all' ? ( char => $char ) : (),