summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbugreport%peshkin.net <>2002-07-31 19:15:54 +0200
committerbugreport%peshkin.net <>2002-07-31 19:15:54 +0200
commit99930ca5c23c93cd177c587899f38c7d93509280 (patch)
treef8eff00d4a94c9718262bb4fe4cb071e076edbe5
parent4329499747e5cd24283db29e90d8f8b609b7324c (diff)
downloadbugzilla-99930ca5c23c93cd177c587899f38c7d93509280.tar.gz
bugzilla-99930ca5c23c93cd177c587899f38c7d93509280.tar.xz
Bug 113459 Bad regexp in emailregexp causes system lockout
-rw-r--r--defparams.pl9
1 files changed, 8 insertions, 1 deletions
diff --git a/defparams.pl b/defparams.pl
index c0e1a9fa9..45e67d532 100644
--- a/defparams.pl
+++ b/defparams.pl
@@ -449,10 +449,17 @@ sub check_webdotbase {
return "";
}
+sub checkregexp {
+ my ($value) = (@_);
+ eval { qr/$value/ };
+ return $@;
+}
+
DefParam("emailregexp",
'This defines the regexp to use for legal email addresses. The default tries to match fully qualified email addresses. Another popular value to put here is <tt>^[^@]+$</tt>, which means "local usernames, no @ allowed."',
"t",
- q:^[^@]+@[^@]+\\.[^@]+$:);
+ q:^[^@]+@[^@]+\\.[^@]+$:,
+ \&checkregexp);
DefParam("emailregexpdesc",
"This describes in english words what kinds of legal addresses are allowed by the <tt>emailregexp</tt> param.",