XPressME Integration Kit

Trac


Ignore:
Timestamp:
Nov 2, 2011, 4:05:15 PM (13 years ago)
Author:
toemon
Message:

マルチバイト、ログインユーザ名への対応

Location:
branches/Ver2.4/xpressme_integration_kit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/Ver2.4/xpressme_integration_kit/include/oninstall.php

    r617 r794  
    161161        $pass_md5 = is_object($GLOBALS["xoopsUser"])?$GLOBALS["xoopsUser"]->getVar("pass"):''; 
    162162         
     163        add_filter('sanitize_user', "sanitize_user_multibyte" ,10,3); 
     164         
    163165        if (!function_exists('username_exists')){ 
    164166                require_once($mydirpath . '/wp-includes/registration-functions.php'); 
     
    296298} 
    297299endif; 
     300if( ! function_exists( 'sanitize_user_multibyte' ) ) : 
     301function sanitize_user_multibyte($username, $raw_username, $strict){ 
     302        if ($username == "" && $strict){ 
     303                if ($raw_username == ""){ 
     304                        return $username; 
     305                } else{ 
     306                        return sanitize_user($raw_username, false); 
     307                } 
     308        } else { 
     309                return $username; 
     310        } 
     311} 
     312endif; 
    298313?> 
  • branches/Ver2.4/xpressme_integration_kit/wp-content/plugins/xpressme/xpressme.php

    r633 r794  
    8282        } 
    8383} 
     84 
     85// enable multibyte username 
     86if( ! function_exists( 'sanitize_user_multibyte' ) ){ 
     87        function sanitize_user_multibyte($username, $raw_username, $strict){ 
     88                if ($username == "" && $strict){ 
     89                        if ($raw_username == ""){ 
     90                                return $username; 
     91                        } else{ 
     92                                return sanitize_user($raw_username, false); 
     93                        } 
     94                } else { 
     95                        return $username; 
     96                } 
     97        } 
     98} 
     99add_filter('sanitize_user', "sanitize_user_multibyte" ,10,3); 
    84100 
    85101add_action('admin_menu', 'my_plugin_menu'); 
Note: See TracChangeset for help on using the changeset viewer.