зеркало из https://github.com/mozilla/gecko-dev.git
Bug 113459 Bad regexp in emailregexp causes system lockout
This commit is contained in:
Родитель
ab4d4c14e0
Коммит
0ba5d772f5
|
@ -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.",
|
||||||
|
|
Загрузка…
Ссылка в новой задаче