Skip to:
Content

BuddyPress.org

Opened 9 years ago

Last modified 8 years ago

#6668 reopened defect (bug)

Better compatibility when using 'BP_ENABLE_USERNAME_COMPATIBILITY_MODE' and UTF-8

Reported by: silu44's profile silu44 Owned by:
Milestone: Awaiting Contributions Priority: high
Severity: normal Version: 1.1
Component: Core Keywords:
Cc:

Description

Dear Sir

i translated buddypress to arabic and i want my members to use arabic user names

it works fine but on : when viewing user profile page this field( @usename in arabic ) return strange characters.

http://store1.up-00.com/2015-10/144506006631.jpg

Attachments (1)

6668.01.patch (515 bytes) - added by r-a-y 9 years ago.

Download all attachments as: .zip

Change History (17)

#1 @DJPaul
9 years ago

Hello @silu44

Please can you give me a sample Arabic username that causes this problem? It will help us check the bug. Thanks.

#2 @silu44
9 years ago

Hi DjPaul

for example this user name ( رماح )

#3 @silu44
9 years ago

here is the code that print the user name :

<span class="user-nicename">@<?php bp_displayed_user_username(); ?></span>


#4 @DJPaul
9 years ago

@silu44

How did you *register* a user name of "رماح" in WordPress?

When I try adding a user through /wp-admin/user-new.php, it won't create the user account.

#5 @silu44
9 years ago

@DJPaul i'm using :

Buddypress + Wordpress Special Characters in Usernames + Paid Memberships Pro

those are the plugins related to my post ,

#6 @r-a-y
9 years ago

  • Keywords has-patch added
  • Version changed from 2.3.3 to 1.9

It looks like we need to run urldecode() on the mention name function.

I'm proposing we add the filter needed to make this work, and then a 3rd-party plugin can run the urldecode() function on this filter:

add_filter( 'bp_activity_get_user_mentionname', 'urldecode' );

Edit: This will fix the mention name display, but we would probably need to fix bp_activity_find_mentions() so it checks url-encoded values as well.

Last edited 9 years ago by r-a-y (previous) (diff)

@r-a-y
9 years ago

#7 @DJPaul
9 years ago

Maaaybe. We can add a filter, sure, but I think would probably want more unit tests to ensure everything's consistent with the parsing and display of these.

At any rate, since the Special Character plugin allows different characters in the username/nicename, I'm tempted to suggest the best quickest fix is to enable BP_ENABLE_USERNAME_COMPATIBILITY_MODE where we already handle URL decoding.

#8 @r-a-y
9 years ago

  • Keywords needs-patch added; has-patch removed

I'm tempted to suggest the best quickest fix is to enable BP_ENABLE_USERNAME_COMPATIBILITY_MODE where we already handle URL decoding.

Good point. We (or a plugin) would still need to apply urldecode() to various spots that generate a user profile URL so the member profile will resolve properly:
add_filter( 'bp_get_member_permalink', 'urldecode' );

Needs further auditing.

#9 @silu44
9 years ago

  • Keywords needs-testing added
  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from new to closed

nothing of the mentioned solutions solved the problem.

#10 @r-a-y
9 years ago

silu44 - For now, you can add the following to wp-content/plugins/bp-custom.php:

// Enable username compatibility
define( 'BP_ENABLE_USERNAME_COMPATIBILITY_MODE', true );

// URL decode member permalinks on the Members Directory page
add_filter( 'bp_get_member_permalink', 'urldecode' );

This probably will not solve 100% of the issues, but it should get you partially there. If you do encounter other bugs, please let us know.

#11 @silu44
9 years ago

  • Keywords needs-patch needs-testing removed

thanks @r-a-y it works fine for me, everything is good now .

i can register with arabic username and nicename
i can view user profile normaly
user permalink is fine .

1-just the user with arabic name not showing up on ( members page or search result )

on localhost it works good , but online not working :
2-when trying to activate user account it say ( can't activate "username" - the sign-up has already been activated. ) and user deleted


Last edited 9 years ago by silu44 (previous) (diff)

#12 @r-a-y
9 years ago

  • Milestone set to 2.5
  • Resolution wontfix deleted
  • Status changed from closed to reopened
  • Summary changed from Strange characters on @username when using arabic to Better compatibility when using 'BP_ENABLE_USERNAME_COMPATIBILITY_MODE' and UTF-8
  • Version changed from 1.9 to 1.1

Going to reopen this.

I think if BP_ENABLE_USERNAME_COMPATIBILITY_MODE is set to true, we should automatically add various filters like the 'bp_get_member_permalink' filter and fix up various things like the activation issue as stated in comment:11.

I'll try and look into these things in 2.5.

This ticket was mentioned in Slack in #buddypress by r-a-y. View the logs.


9 years ago

#14 @DJPaul
9 years ago

  • Milestone changed from 2.5 to 2.6

#15 @DJPaul
8 years ago

  • Milestone changed from 2.6 to Future Release

#16 @DJPaul
8 years ago

  • Component changed from API to Core
Note: See TracTickets for help on using tickets.