*** empty log message ***

svn path=/trunk/boinc/; revision=8562
This commit is contained in:
David Anderson 2005-10-08 19:12:43 +00:00
parent be0d83b57c
commit d6b863c84d
2 changed files with 20 additions and 1 deletions

View File

@ -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

View File

@ -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.");
}