From e76400fc59da6366444e6233c09b6edf9be7de5b Mon Sep 17 00:00:00 2001 From: "mkanat%bugzilla.org" Date: Wed, 19 Dec 2012 23:00:43 +0000 Subject: [PATCH] Bug 818621: Perl 5.16 complains with "Variable length lookbehind not implemented in regex" when the Example extension is enabled r=dkl a=LpSolit git-svn-id: svn://10.0.0.236/trunk@264578 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/webtools/bugzilla/.bzrrev | 2 +- mozilla/webtools/bugzilla/extensions/Example/Extension.pm | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/mozilla/webtools/bugzilla/.bzrrev b/mozilla/webtools/bugzilla/.bzrrev index f1bc2351693..2c8215b7229 100644 --- a/mozilla/webtools/bugzilla/.bzrrev +++ b/mozilla/webtools/bugzilla/.bzrrev @@ -1 +1 @@ -8520 \ No newline at end of file +8521 \ No newline at end of file diff --git a/mozilla/webtools/bugzilla/extensions/Example/Extension.pm b/mozilla/webtools/bugzilla/extensions/Example/Extension.pm index 76e866b3c06..7fc9072dc75 100644 --- a/mozilla/webtools/bugzilla/extensions/Example/Extension.pm +++ b/mozilla/webtools/bugzilla/extensions/Example/Extension.pm @@ -444,7 +444,13 @@ sub error_catch { my $new_error_msg = "Ah ah, you tried to access $page_id? Good try!"; $new_error_msg = html_quote($new_error_msg); # There are better tools to parse an HTML page, but it's just an example. - $$page =~ s/(?<=).*(?=<\/td>)/$new_error_msg/si; + # Since Perl 5.16, we can no longer write "class" inside look-behind + # assertions, because "ss" is also seen as the german ß character, which + # makes Perl 5.16 complain. The right fix is to use the /aa modifier, + # but it's only understood since Perl 5.14. So the workaround is to write + # "clas[s]" instead of "class". Stupid and ugly hack, but it works with + # all Perl versions. + $$page =~ s/(?<=).*(?=<\/td>)/$new_error_msg/si; } sub flag_end_of_update {