Loading lib/DBInfoscreen/Helper/HAFAS.pm +7 −1 Original line number Diff line number Diff line Loading @@ -99,16 +99,22 @@ sub get_xml_p { my $body = decode( 'ISO-8859-15', $tx->res->body ); # <SDay text="... > ..."> is invalid HTML, but present # <SDay text="... > ..."> is invalid XML, but present # regardless. As it is the last tag, we just throw it away. $body =~ s{<SDay [^>]*/>}{}s; # <Attribute [...] text="[...] "[...]"" prio="800" /> is invalid XML. # Work around it. $body =~ s{<Attribute text="([^"]*)"([^"=]*)""}{<Attribute text="$1*$2*"}s; my $tree; eval { $tree = XML::LibXML->load_xml( string => $body ) }; if ($@) { $cache->freeze( $url, {} ); $self->{log}->debug("hafas->get_xml_p($url): Parse Error: $@"); $promise->reject; return; } Loading Loading
lib/DBInfoscreen/Helper/HAFAS.pm +7 −1 Original line number Diff line number Diff line Loading @@ -99,16 +99,22 @@ sub get_xml_p { my $body = decode( 'ISO-8859-15', $tx->res->body ); # <SDay text="... > ..."> is invalid HTML, but present # <SDay text="... > ..."> is invalid XML, but present # regardless. As it is the last tag, we just throw it away. $body =~ s{<SDay [^>]*/>}{}s; # <Attribute [...] text="[...] "[...]"" prio="800" /> is invalid XML. # Work around it. $body =~ s{<Attribute text="([^"]*)"([^"=]*)""}{<Attribute text="$1*$2*"}s; my $tree; eval { $tree = XML::LibXML->load_xml( string => $body ) }; if ($@) { $cache->freeze( $url, {} ); $self->{log}->debug("hafas->get_xml_p($url): Parse Error: $@"); $promise->reject; return; } Loading