summaryrefslogtreecommitdiffstats
path: root/extensions/Example/Extension.pm
diff options
context:
space:
mode:
Diffstat (limited to 'extensions/Example/Extension.pm')
-rw-r--r--extensions/Example/Extension.pm10
1 files changed, 2 insertions, 8 deletions
diff --git a/extensions/Example/Extension.pm b/extensions/Example/Extension.pm
index 40ee9c2d1..ef27200ac 100644
--- a/extensions/Example/Extension.pm
+++ b/extensions/Example/Extension.pm
@@ -7,7 +7,7 @@
package Bugzilla::Extension::Example;
-use 5.10.1;
+use 5.14.0;
use strict;
use warnings;
@@ -479,13 +479,7 @@ 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.
- # 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;
+ $$page =~ s/<div id="error_msg" class="throw_error">\K(.*)/$new_error_msg<br>$1/siaa;
}
sub flag_end_of_update {