mirror of https://github.com/BOINC/boinc.git
*** empty log message ***
svn path=/trunk/boinc/; revision=8562
This commit is contained in:
parent
be0d83b57c
commit
d6b863c84d
|
@ -12872,3 +12872,11 @@ Rom 7 Oct 2005
|
|||
|
||||
client/
|
||||
cs_prefs.C
|
||||
|
||||
David 8 Oct 2005
|
||||
- password change used mb_detect_encoding(),
|
||||
which apparently isn't included by default,
|
||||
to check for non-ASCII. Use hand_written check instead.
|
||||
|
||||
html/user/
|
||||
edit_passwd_action.php
|
||||
|
|
|
@ -6,6 +6,17 @@ require_once("../inc/user.inc");
|
|||
|
||||
db_init();
|
||||
|
||||
function is_ascii($str) {
|
||||
// the mb_* functions are not included by default
|
||||
// return (mb_detect_encoding($passwd) -= 'ASCII');
|
||||
|
||||
for ($i=0; $i<strlen($str); $i++) {
|
||||
$c = ord(substr($str, $i));
|
||||
if ($c < 32 || $c > 127) return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
$auth = process_user_text(post_str("auth", true));
|
||||
$email_addr = strtolower(process_user_text(post_str("email_addr", true)));
|
||||
|
||||
|
@ -24,7 +35,7 @@ $config = get_config();
|
|||
$min_passwd_length = parse_config($config, "<min_passwd_length>");
|
||||
if (!$min_passwd_length) $min_passwd_length = 6;
|
||||
|
||||
if (mb_detect_encoding($passwd) != 'ASCII') {
|
||||
if (!is_ascii($passwd)) {
|
||||
error_page("Passwords may only include ASCII characters.");
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue