From 57602c4604197bfce27e09115c30ab54b50d014a Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Fri, 11 Nov 2011 11:57:05 +0100 Subject: Do not strip city prefix for Hbf --- cgi/index.pl | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'cgi') diff --git a/cgi/index.pl b/cgi/index.pl index 3a15567..db519f6 100644 --- a/cgi/index.pl +++ b/cgi/index.pl @@ -43,7 +43,7 @@ sub handle_request { my $no_lines = $self->param('no_lines'); - if ($no_lines < 1 or $no_lines > 10) { + if ( $no_lines < 1 or $no_lines > 10 ) { $no_lines = default_no_lines(); } @@ -66,7 +66,9 @@ sub handle_request { sub shorten_destination { my ( $dest, $city ) = @_; - $dest =~ s{ ^ $city \s }{}ix; + if ( not( $dest =~ m{ Hbf $ }ix ) ) { + $dest =~ s{ ^ $city \s }{}ix; + } if ( length($dest) > 20 ) { $dest =~ s{^Dortmund}{DO} @@ -112,7 +114,7 @@ sub render_image { @grep_platform = split( qr{,}, $self->param('platform') ); } - if ($no_lines < 1 or $no_lines > 10) { + if ( $no_lines < 1 or $no_lines > 10 ) { $no_lines = default_no_lines(); } @@ -197,8 +199,9 @@ get '/_redirect' => sub { $params->remove('city'); $params->remove('stop'); - if (not $params->param('no_lines') or $params->param('no_lines') == - default_no_lines()) { + if ( not $params->param('no_lines') + or $params->param('no_lines') == default_no_lines() ) + { $params->remove('no_lines'); } -- cgit v1.2.3