From 523817239799733c15b900506ad57c5fc87c29de Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sat, 19 Nov 2011 19:55:37 +0100 Subject: sanitize platform number, add platform_db accessor --- lib/Travel/Status/DE/VRR.pm | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib/Travel/Status/DE/VRR.pm') diff --git a/lib/Travel/Status/DE/VRR.pm b/lib/Travel/Status/DE/VRR.pm index f976c1e..065d56c 100644 --- a/lib/Travel/Status/DE/VRR.pm +++ b/lib/Travel/Status/DE/VRR.pm @@ -187,12 +187,19 @@ sub results { my $countdown = $e->getAttribute('countdown'); my $delay = $e_info->getAttribute('delay') // 0; + my $platform_is_db = 0; + + if ( $platform =~ s{ ^ \# }{}ox ) { + $platform_is_db = 1; + } + push( @results, Travel::Status::DE::VRR::Result->new( date => $rdate, time => $rtime, platform => $platform, + platform_db => $platform_is_db, line => $line, destination => decode( 'UTF-8', $dest ), countdown => $countdown, -- cgit v1.2.3