Subject: | Unescaped left brace in regex is deprecated, passed through in regex |
This module warns when used with Perl 5.22:
# Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/(?i:^([a-z]*scrip
t\s*:|.*\&{ <-- HERE |mocha|hcp|opera\s*:|about\s*:|smb|/dev/|<))|[^\x00-\x7f]/ at /usr/share/perl5/HTML/Defang.p
m line 181.
# Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/expression|eval|s
cript:|mocha:|\&{ <-- HERE |\@import/ at /usr/share/perl5/HTML/Defang.pm line 207.
# Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/^([A-Za-z]*script
|.*\&{ <-- HERE |mocha|about|opera|mailto:|hcp:|/(dev|proc)|\\|file|smb|cid:([^@]\.com|.*\.(exe|cmd|bat|pif|scr|s
ys|sct|lnk|dll|vbs?|vbe|hta|shb|shs|hlp|chm|eml|wsf|wsh|js|asx|wm.|mdb|mht|msi|msp|cpl|lib|reg))(@|\?|$))/ at /us
r/share/perl5/HTML/Defang.pm line 160.
Proposed patches attached, divided to one for the actual code and one for the test suite.
Subject: | 0001-Fix-regexp-syntax-for-Perl-5.22.patch |
From 119de7f13a4bbc6bded2dc8f8a2933ae5fbb4822 Mon Sep 17 00:00:00 2001
From: Niko Tyni <ntyni@debian.org>
Date: Sun, 27 Dec 2015 18:22:25 +0200
Subject: [PATCH 1/2] Fix regexp syntax for Perl 5.22
Perl 5.22 introduced the warning
Unescaped left brace in regex is deprecated, passed through in regex
which triggers in these regexps.
Bug-Debian: https://bugs.debian.org/809096
---
lib/HTML/Defang.pm | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/lib/HTML/Defang.pm b/lib/HTML/Defang.pm
index c97b7b3..61794d8 100644
--- a/lib/HTML/Defang.pm
+++ b/lib/HTML/Defang.pm
@@ -157,7 +157,7 @@ my $Executables = '([^@]\.com|'.
'.*\.(exe|cmd|bat|pif|scr|sys|sct|lnk|dll'.
'|vbs?|vbe|hta|shb|shs|hlp|chm|eml|wsf|wsh|js'.
'|asx|wm.|mdb|mht|msi|msp|cpl|lib|reg))';
-my $SrcBanStd = qr/^([A-Za-z]*script|.*\&{|mocha|about|opera|mailto:|hcp:|\/(dev|proc)|\\|file|smb|cid:${Executables}(@|\?|$))/i;
+my $SrcBanStd = qr/^([A-Za-z]*script|.*\&\{|mocha|about|opera|mailto:|hcp:|\/(dev|proc)|\\|file|smb|cid:${Executables}(@|\?|$))/i;
my %Rules =
(
@@ -178,7 +178,7 @@ my %Rules =
"form-method" => qr/^(get|post)$/i,
"frame" => qr/^(void|above|below|hsides|vsides|lhs|rhs|box|border)$/i,
# href: Not javascript, vbs or vbscript
- "href" => [ qr/(?i:^([a-z]*script\s*:|.*\&{|mocha|hcp|opera\s*:|about\s*:|smb|\/dev\/|<))|[^\x00-\x7f]/ ],
+ "href" => [ qr/(?i:^([a-z]*script\s*:|.*\&\{|mocha|hcp|opera\s*:|about\s*:|smb|\/dev\/|<))|[^\x00-\x7f]/ ],
"usemap-href" => qr/^#[A-Za-z0-9_.-]+$/, # this is not really a href at all!
"input-size" => qr/^(\d{1,4})$/, # some browsers freak out with very large widgets
"input-type" => qr/^(button|checkbox|file|hidden|image|password|radio|readonly|reset|submit|text)$/i,
@@ -204,7 +204,7 @@ my %Rules =
# "style" => qr/expression|eval|script:|mocha:|\&{|\@import|(?<!background-)position:|background-image/i, # XXX there are probably a million more ways to cause trouble with css!
"style" => qr/^.*$/s,
#kc In addition to this, we could strip all 'javascript:|expression|' etc. from all attributes(in attribute_cleanup())
- "stylesheet" => [ qr/expression|eval|script:|mocha:|\&{|\@import/i ], # stylesheets are forbidden if Embedded => 1. css positioning can be allowed in an iframe.
+ "stylesheet" => [ qr/expression|eval|script:|mocha:|\&\{|\@import/i ], # stylesheets are forbidden if Embedded => 1. css positioning can be allowed in an iframe.
# NB see also `process_stylesheet' below
"style-type" => [ qr/script|mocha/i ],
"size" => qr/^[\d.]+(px|%)?$/i,
--
2.6.4
Subject: | 0002-Fix-test-script-regexp-syntax-for-Perl-5.22.patch |
Message body is not shown because it is too large.