Handle invalid HAFAS XML containing "Wagen \d+ & \d+"

This commit is contained in:
Daniel Friesel 2021-01-05 22:27:46 +01:00
parent 5e29b99d61
commit db39b2a177

View file

@ -1,4 +1,5 @@
package Travelynx::Helper::HAFAS; package Travelynx::Helper::HAFAS;
# Copyright (C) 2020 Daniel Friesel # Copyright (C) 2020 Daniel Friesel
# #
# SPDX-License-Identifier: MIT # SPDX-License-Identifier: MIT
@ -194,6 +195,7 @@ sub get_xml_p {
# More fixes for invalid XML # More fixes for invalid XML
$body =~ s{P&R}{P&R}; $body =~ s{P&R}{P&R};
$body =~ s{Wagen \d+ \K&(?= )}{&};
# <Attribute [...] text="[...] "[...]"" /> is invalid XML. # <Attribute [...] text="[...] "[...]"" /> is invalid XML.
# Work around it. # Work around it.