From d6b863c84d289000f01d8806d7f8fb1e32c60c6e Mon Sep 17 00:00:00 2001 From: David Anderson Date: Sat, 8 Oct 2005 19:12:43 +0000 Subject: [PATCH] *** empty log message *** svn path=/trunk/boinc/; revision=8562 --- checkin_notes | 8 ++++++++ html/user/edit_passwd_action.php | 13 ++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/checkin_notes b/checkin_notes index 54af456056..3a9e0cf08d 100755 --- a/checkin_notes +++ b/checkin_notes @@ -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 diff --git a/html/user/edit_passwd_action.php b/html/user/edit_passwd_action.php index bdb1d447ea..ad4b6fe8f4 100644 --- a/html/user/edit_passwd_action.php +++ b/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 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, ""); 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."); }