aboutsummaryrefslogtreecommitdiffstats
path: root/extensions/Example
diff options
context:
space:
mode:
authorFrédéric Buclin <LpSolit@gmail.com>2012-12-19 23:50:18 +0100
committerFrédéric Buclin <LpSolit@gmail.com>2012-12-19 23:50:18 +0100
commit6fa62b73a57e7814245b36027fa376ef2f4716fa (patch)
treebb426ef8013b9b1599c7892c97748fcab07532ad /extensions/Example
parent3272176a7b37b3bd30ef376f7b782f736d207cd4 (diff)
downloadbugs-6fa62b73a57e7814245b36027fa376ef2f4716fa.tar
bugs-6fa62b73a57e7814245b36027fa376ef2f4716fa.tar.gz
bugs-6fa62b73a57e7814245b36027fa376ef2f4716fa.tar.bz2
bugs-6fa62b73a57e7814245b36027fa376ef2f4716fa.tar.xz
bugs-6fa62b73a57e7814245b36027fa376ef2f4716fa.zip
Bug 818621: Perl 5.16 complains with "Variable length lookbehind not implemented in regex" when the Example extension is enabled
r=dkl a=LpSolit
Diffstat (limited to 'extensions/Example')
-rw-r--r--extensions/Example/Extension.pm8
1 files changed, 7 insertions, 1 deletions
diff --git a/extensions/Example/Extension.pm b/extensions/Example/Extension.pm
index 76e866b3c..7fc9072dc 100644
--- a/extensions/Example/Extension.pm
+++ b/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 id="error_msg" class="throw_error">).*(?=<\/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 id="error_msg" clas[s]="throw_error">).*(?=<\/td>)/$new_error_msg/si;
}
sub flag_end_of_update {