Opened 13 years ago
Closed 13 years ago
#408 closed バグ(bug) (fixed)
ログイン名がマルチバイトだとユーザ登録できない
Reported by: | toemon | Owned by: | toemon |
---|---|---|---|
Priority: | 普通 | Milestone: | Ver.2.4.2 |
Component: | 一般 | Version: | 2.4.1 |
Severity: | 普通 | Keywords: | |
Cc: |
Description
XOOPSの管理者名が日本語などマルチバイトだと、XPressのインストールの際、インストールは終了するけれどXPress側のユーザーテーブルにデータが挿入されず、インストール後に管理者がログインできない。
thx naao
Change History (4)
comment:1 Changed 13 years ago by toemon
comment:2 Changed 13 years ago by toemon
- Resolution set to 修正済み
- Status changed from new to closed
r794 にて修正完了
add_filter('sanitize_user', "sanitize_user_multibyte" ,10,3);
にて
function sanitize_user_multibyte($username, $raw_username, $strict){ if ($username == "" && $strict){ if ($raw_username == ""){ return $username; } else{ return sanitize_user($raw_username, false); } } else { return $username; } }
を呼び出してフィルタリングする。
comment:3 Changed 13 years ago by toemon
- Resolution 修正済み deleted
- Status changed from closed to reopened
r794 の修正では、たとえばユーザ名が「藤右衛門123」だと、「123」として登録されてしまう。
XOOPSユーザから、WordPressユーザデータを作成する際は、sanitize_userそのものをパスするようにしたほうがよいかも、
function sanitize_user_multibyte($username, $raw_username, $strict){ if ($username !== $raw_username) return $raw_username; return $username; }
comment:4 Changed 13 years ago by toemon
- Resolution set to fixed
- Status changed from reopened to closed
Note: See
TracTickets for help on using
tickets.
WP側のユーザ登録時wp-include/formatting.phpのsanitize_user()でsanitize_user( 'ユーザー名', true )としてサニタイズされるため、マルチバイト名が使えなくなってしまっている。