summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2011-11-11 11:57:05 +0100
committerDaniel Friesel <derf@finalrewind.org>2011-11-11 11:57:05 +0100
commit57602c4604197bfce27e09115c30ab54b50d014a (patch)
tree10d8d0a82f2190463d69f7a03467261188c32583
parent985f96b0f11c6b7793361a3f1fe34ab3f915cecb (diff)
Do not strip city prefix for Hbf
-rw-r--r--cgi/index.pl13
1 files changed, 8 insertions, 5 deletions
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');
}