Opened 17 years ago
Closed 16 years ago
#2066 closed defect (bug) (fixed)
Wrong non-latin slugs (in activity stream, group names etc.)
| Reported by: | motomac | Owned by: | |
|---|---|---|---|
| Priority: | major | Milestone: | 1.5 |
| Component: | Core | Version: | |
| Severity: | Keywords: | cyrillic | |
| Cc: |
Description
In activity stream link "View" doesn't work, if the name of blog post or name of forum topic contains cyrillic and is long.
See here: http://testbp.org/members/motomac/
Attachments (1)
Change History (13)
#2
@
16 years ago
For example, cyrillic string:
Проверка кириллицы. Проверка кириллицы. Проверка кириллицы. Проверка кириллицы
#3
@
16 years ago
- Summary Cyrillic in the names of items in activity stream → Wrong non-latin slugs (in activity stream, group names etc.)
Simple solution is to increase limit of symbols for slugs tables in the database:
primary_link in wp_bp_activity make varchar(300), for example.
And make the same with other slug tables (group names, for example): slug in wp_bp_groups (varchar(900)).
It happens because non-latin symbols take more space then latinic (*6 times longer).
#5
@
16 years ago
Just to config this bug for 1.2.7.
The same behavior with long Greek titles of blog posts.
#6
@
16 years ago
Obviously the blog post slugs aren't anything to do with BuddyPress. In 1.3, activity stream character limit has gone up to 200. See the notes on #880. Activity stream view link with the example above works okay for me. Could someone give trunk the once-over and find out what other slugs still break?
#7
@
16 years ago
200 character limit allows up to 33 non-Latin characters. It's obviously better than the previous 100 character limit (which only allowed up to 16 non-Latin characters) and probably should be enough for group slugs, however forum topic titles can be longer, I guess.
motomac's example slug is being cut, but actually works on current trunk. We just need to make sure that cutting a slug doesn't break its last symbol, like it happened in #880. From what I've tested so far, that doesn't seem to happen now.
#8
@
16 years ago
Oh, I see. Thank you for the explanation. FYI, 200 is the magic number because that's the size of the wp_posts table 'post_name' column which is relevant because BuddyPress will be moving to custom post types in the future.
#9
@
16 years ago
The important thing about the 200 character limit is that it is the size used in sanitize_title_with_dashes(). As long as we allow for at least that much space, WP will make sure that the uri-encoded non-latin slug is never cut off, and is always unique. It might not make for pretty URLs all the time, but it will at least ensure that links won't break.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
How do we fix it? What should the link be?