diff options
author | Daniel Friesel <derf@finalrewind.org> | 2019-05-30 23:56:20 +0200 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2019-05-30 23:56:20 +0200 |
commit | ecd4b4845b95c193a319fa62251328bc6e905f5b (patch) | |
tree | 588efc4d8f3b00b96665886dac89abc64352dafc /lib/DBInfoscreen/Controller/Stationboard.pm | |
parent | ebf9365f88581bb5f6b618ad8af9ae2f19695119 (diff) |
Fix issues with invalid XML returned by HAFAS backend
Diffstat (limited to 'lib/DBInfoscreen/Controller/Stationboard.pm')
-rw-r--r-- | lib/DBInfoscreen/Controller/Stationboard.pm | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/DBInfoscreen/Controller/Stationboard.pm b/lib/DBInfoscreen/Controller/Stationboard.pm index a28a523..67fd727 100644 --- a/lib/DBInfoscreen/Controller/Stationboard.pm +++ b/lib/DBInfoscreen/Controller/Stationboard.pm @@ -146,6 +146,10 @@ sub hafas_xml_req { my $body = decode( 'ISO-8859-15', $res->body ); + # <SDay text="... > ..."> is invalid HTML, but present + # regardless. As it is the last tag, we just throw it away. + $body =~ s{<SDay .*}{</Journey>}s; + my $tree; eval { $tree = XML::LibXML->load_xml( string => $body ) }; |