From db39b2a17733ab14d135133395417a1eb10bc004 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Tue, 5 Jan 2021 22:27:46 +0100 Subject: [PATCH] Handle invalid HAFAS XML containing "Wagen \d+ & \d+" --- lib/Travelynx/Helper/HAFAS.pm | 2 ++ 1 file changed, 2 insertions(+) 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&R}; + $body =~ s{Wagen \d+ \K&(?= )}{&}; # is invalid XML. # Work around it.