summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2015-09-12 21:22:15 +0200
committerDaniel Friesel <derf@finalrewind.org>2015-09-12 21:22:15 +0200
commita21801194dfeab91136857dab62aa90ac396f5c4 (patch)
tree3f13abe1e1c885d8ebae4be9c2c3253b4703ecd3 /lib
parent07d8ef6646413fc2a8585f9ae64ca75f55764bd7 (diff)
HAFAS.pm: improve NVV fixup regex (thanks penma)
Diffstat (limited to 'lib')
-rw-r--r--lib/Travel/Status/DE/HAFAS.pm8
1 files changed, 1 insertions, 7 deletions
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} ) {