From ecd4b4845b95c193a319fa62251328bc6e905f5b Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Thu, 30 May 2019 23:56:20 +0200 Subject: Fix issues with invalid XML returned by HAFAS backend --- lib/DBInfoscreen/Controller/Stationboard.pm | 4 ++++ 1 file changed, 4 insertions(+) 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 ); + # is invalid HTML, but present + # regardless. As it is the last tag, we just throw it away. + $body =~ s{}s; + my $tree; eval { $tree = XML::LibXML->load_xml( string => $body ) }; -- cgit v1.2.3