summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2021-01-05 22:27:46 +0100
committerDaniel Friesel <derf@finalrewind.org>2021-01-05 22:27:46 +0100
commitdb39b2a17733ab14d135133395417a1eb10bc004 (patch)
tree3523e556e78c707afb0e165e890bed59942012b0 /lib
parent5e29b99d617b55275221ae9cd6370eff4c19bd3b (diff)
Handle invalid HAFAS XML containing "Wagen \d+ & \d+"
Diffstat (limited to 'lib')
-rw-r--r--lib/Travelynx/Helper/HAFAS.pm2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/Travelynx/Helper/HAFAS.pm b/lib/Travelynx/Helper/HAFAS.pm
index a4035af..98ac4b9 100644
--- a/lib/Travelynx/Helper/HAFAS.pm
+++ b/lib/Travelynx/Helper/HAFAS.pm
@@ -1,4 +1,5 @@
package Travelynx::Helper::HAFAS;
+
# Copyright (C) 2020 Daniel Friesel
#
# SPDX-License-Identifier: MIT
@@ -194,6 +195,7 @@ sub get_xml_p {
# More fixes for invalid XML
$body =~ s{P&R}{P&amp;R};
+ $body =~ s{Wagen \d+ \K&(?= )}{&amp;};
# <Attribute [...] text="[...] "[...]"" /> is invalid XML.
# Work around it.