Skip to:
Content
Pages
Categories
Search
Top
Bottom

BP-FBConnect – usernames with foreign characters


  • Hannes
    Participant

    @funkpunk

    I’ve been trying out the BP-FBConnect plugin. It looks like it creates usernames for people based on the name that’s registered in Facebook. Something like: http://example.com/members/fullnameinfacebook/

    That’s great but it looks like it doesn’t handle foreign characters properly. For example, if somebody has the letter “ó” in their name that letter is just skipped when creating the username instead of using “o”.

    It would be nice if this would be looked into.

Viewing 6 replies - 1 through 6 (of 6 total)

  • takuya
    Participant

    @takuya

    WordPress and therefore BuddyPress lack a lot of standard i18n features as core developers are mainly using English than other languages. They still haven’t figured out problems we have when we use our own languages within WordPress/BuddyPress.

    Anyway, for the problem, there’s similar ticket on trac that names containing dots or dash don’t work on 1.1 environment. It may be related to this ticket.

    As much as I can tell, being one of those English-speaking imperialists to which you refer, WordPress has a good range of i18n stuff if developers use the right functions. If you think WordPress and BuddyPress seriously lack in these areas, then please by all means start a specific discussion thread on each product’s forums or file trac tickets/bug reports/patches.

    Back on topic, I think socialpreneur’s on the money with this.


    takuya
    Participant

    @takuya

    @DJPaul

    I’ve been doing it on trac and forums…but I rarely get updates.


    levin
    Participant

    @levinng

    make a plugin as below to allow non-ansi character account name

    <?php

    add_filter( 'sanitize_user', 'my_sanitize_user',3,3);

    function my_sanitize_user($username, $raw_username, $strict){

    $username = $raw_username;

    $username = strip_tags($username);

    $username = preg_replace('|%([a-fA-F0-9][a-fA-F0-9])|', '', $username);

    $username = preg_replace('/&.+?;/', '', $username); // Kill entities

    if ( $strict )

    $username = preg_replace('|[^a-z0-9 _.\-@\x80-\xFF]|i', '', $username);

    $username = preg_replace('|\s+|', ' ', $username);

    return $username;

    }

    ?>

    I repeat myself: if you have come up with a patch which improves I18n in WordPress, then create a ticket on the core WP trac so people can look at it.


    levin
    Participant

    @levinng

    It was encountered when the FB user’s name contains full of chinese characters, all characters pass into wp insert users function will be stripped(because wp username is ansi only), it finally added a empty character user_login/user_nicename, also user_url will be http://www.facebook.com/people//XXXXXXX

    That user can still login, but cannot access his profile page indeed.

    I’d like to suggest the future BP-FBConnect, could use the character test statement, if found incompatible username characters, then just simply replace it with FacebookUser instead.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘BP-FBConnect – usernames with foreign characters’ is closed to new replies.
Skip to toolbar