Bug 113459 Bad regexp in emailregexp causes system lockout

This commit is contained in:
bugreport%peshkin.net 2002-07-31 10:15:54 +00:00
Родитель ab4d4c14e0
Коммит 0ba5d772f5
1 изменённых файлов: 8 добавлений и 1 удалений

Просмотреть файл

@ -449,10 +449,17 @@ sub check_webdotbase {
return ""; return "";
} }
sub checkregexp {
my ($value) = (@_);
eval { qr/$value/ };
return $@;
}
DefParam("emailregexp", 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."', '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", "t",
q:^[^@]+@[^@]+\\.[^@]+$:); q:^[^@]+@[^@]+\\.[^@]+$:,
\&checkregexp);
DefParam("emailregexpdesc", DefParam("emailregexpdesc",
"This describes in english words what kinds of legal addresses are allowed by the <tt>emailregexp</tt> param.", "This describes in english words what kinds of legal addresses are allowed by the <tt>emailregexp</tt> param.",