From ee38d48a555e0c9a8ccb4ca06d69566198f42714 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Wed, 12 Feb 2020 20:35:27 +0100 Subject: [PATCH] Add another fix for invalid HAFAS XML --- lib/Travelynx.pm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/Travelynx.pm b/lib/Travelynx.pm index aeb09d1..ea7ab58 100755 --- a/lib/Travelynx.pm +++ b/lib/Travelynx.pm @@ -2173,6 +2173,9 @@ sub startup { # is invalid HTML, but present in # regardless. As it is the last tag, we just throw it away. $body =~ s{]*/>}{}s; + + # More fixes for invalid XML + $body =~ s{P&R}{P&R}; eval { $tree = XML::LibXML->load_xml( string => $body ) }; if ($@) { $self->app->log->warn("load_xml($url): $@");