From a21801194dfeab91136857dab62aa90ac396f5c4 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sat, 12 Sep 2015 21:22:15 +0200 Subject: HAFAS.pm: improve NVV fixup regex (thanks penma) --- lib/Travel/Status/DE/HAFAS.pm | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'lib/Travel/Status/DE') diff --git a/lib/Travel/Status/DE/HAFAS.pm b/lib/Travel/Status/DE/HAFAS.pm index d96c7de..222b020 100644 --- a/lib/Travel/Status/DE/HAFAS.pm +++ b/lib/Travel/Status/DE/HAFAS.pm @@ -102,13 +102,7 @@ sub new { # Returns invalid XML with tags inside HIMMessage's lead attribute. # Fix this. - # Also, I couldn't get this to work with - # $ref->{raw_xml} =~ s{ ( lead = " [^"]+? ) < [^>]* > }{$1}xg; - # and am probably missing some essential caveat here. - # Working patches are very welcome. - while ( $ref->{raw_xml} =~ m{ lead = " [^"]+ < }x ) { - $ref->{raw_xml} =~ s{ ( lead = " [^"]+ ) < [^>]* > }{$1}x; - } + $ref->{raw_xml} =~ s{ lead = " \K ( [^"]+ ) }{ $1 =~ s{ < [^>]+ > }{}egr }ex; } if ( $ref->{developer_mode} ) { -- cgit v1.2.3