Opened 14 years ago
Last modified 14 years ago
#408 closed バグ(bug)
ログイン名がマルチバイトだとユーザ登録できない — at Version 1
| 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
Note: See
TracTickets for help on using
tickets.
WP側のユーザ登録時wp-include/formatting.phpのsanitize_user()でsanitize_user( 'ユーザー名', true )としてサニタイズされるため、マルチバイト名が使えなくなってしまっている。
function sanitize_user( $username, $strict = false ) { $raw_username = $username; $username = wp_strip_all_tags( $username ); $username = remove_accents( $username ); // Kill octets $username = preg_replace( '|%([a-fA-F0-9][a-fA-F0-9])|', '', $username ); $username = preg_replace( '/&.+?;/', '', $username ); // Kill entities // If strict, reduce to ASCII for max portability. if ( $strict ) $username = preg_replace( '|[^a-z0-9 _.\-@]|i', '', $username ); $username = trim( $username ); // Consolidate contiguous whitespace $username = preg_replace( '|\s+|', ' ', $username ); return apply_filters( 'sanitize_user', $username, $raw_username, $strict ); }