summaryrefslogtreecommitdiff
path: root/lib/Travelynx.pm
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2020-02-12 20:35:27 +0100
committerDaniel Friesel <derf@finalrewind.org>2020-02-12 20:35:27 +0100
commitee38d48a555e0c9a8ccb4ca06d69566198f42714 (patch)
tree71575d7980c8bd080e4d2e92bd8a4dc3d41d9f5c /lib/Travelynx.pm
parent7564ec34db313bd41459defcdccf43fa03a8fe32 (diff)
Add another fix for invalid HAFAS XML
Diffstat (limited to 'lib/Travelynx.pm')
-rwxr-xr-xlib/Travelynx.pm3
1 files changed, 3 insertions, 0 deletions
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 {
# <SDay text="... &gt; ..."> is invalid HTML, but present in
# regardless. As it is the last tag, we just throw it away.
$body =~ s{<SDay [^>]*/>}{}s;
+
+ # More fixes for invalid XML
+ $body =~ s{P&R}{P&amp;R};
eval { $tree = XML::LibXML->load_xml( string => $body ) };
if ($@) {
$self->app->log->warn("load_xml($url): $@");