From c70280a93562e34ad3a711e23d138a96aca5ad58 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sun, 25 Oct 2020 16:35:43 +0100 Subject: Merge HAFAS XML fix from DBF --- lib/Travelynx/Helper/HAFAS.pm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/Travelynx/Helper/HAFAS.pm b/lib/Travelynx/Helper/HAFAS.pm index 5253a4e..6aefcf1 100644 --- a/lib/Travelynx/Helper/HAFAS.pm +++ b/lib/Travelynx/Helper/HAFAS.pm @@ -185,12 +185,17 @@ sub get_xml_p { messages => [], }; - # is invalid HTML, but present in + # is invalid XML, 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}; + + # is invalid XML. + # Work around it. + $body + =~ s{]+)text="([^"]*)"([^"=]*)""}{load_xml( string => $body ) }; if ($@) { $self->{log}->info("load_xml($url): $@"); -- cgit v1.2.3