summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2019-05-30 23:56:20 +0200
committerDaniel Friesel <derf@finalrewind.org>2019-05-30 23:56:20 +0200
commitecd4b4845b95c193a319fa62251328bc6e905f5b (patch)
tree588efc4d8f3b00b96665886dac89abc64352dafc /lib
parentebf9365f88581bb5f6b618ad8af9ae2f19695119 (diff)
Fix issues with invalid XML returned by HAFAS backend
Diffstat (limited to 'lib')
-rw-r--r--lib/DBInfoscreen/Controller/Stationboard.pm4
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="... &gt; ..."> 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 ) };