Opened 16 years ago
Closed 16 years ago
#8419 closed enhancement (fixed)
get_sample_permalink_html not multi-byte safe
Reported by: | janbrasna | Owned by: | |
---|---|---|---|
Milestone: | 2.7 | Priority: | low |
Severity: | minor | Version: | 2.7 |
Component: | Administration | Keywords: | utf multibyte has-patch |
Focuses: | Cc: |
Description
The code of get_sample_permalink_html()
if (strlen($post_name) > 30) { $post_name_abridged = substr($post_name, 0, 14). '…' . substr($post_name, -14); }
in wp-admin/includes/post.php produces invalid string in case the input is multi-byte. That doesn't happen in default, but might happen in case when 'editable_slug' filter changes the slug (e.g. #8418).
What's the consensus on mb_ functions? I've seen several cases of function check in the code as
http://trac.wordpress.org/browser/trunk/wp-includes/formatting.php?rev=9661#L513 but there are also cases like http://trac.wordpress.org/browser/trunk/wp-includes/formatting.php?rev=9661#L2071 when the presence of mb_ is not checked at all.
Attachments (1)
Change History (8)
#2
@
16 years ago
Would make sense to fix it for this problem. However, it should probably be done for all areas also.
#3
follow-up:
↓ 5
@
16 years ago
I'm fully aware of the mb_ issue, hence the last paragraph.
I don't have a problem with writing the patch conditionally, however if you look at the current code, there are mb_ functions already used without a check for mb_ extension.
#4
@
16 years ago
- Keywords dev-feedback 2nd-opinion added
I'll try to tag it for dev review to get some some insight.
#5
in reply to:
↑ 3
@
16 years ago
- Keywords needs-patch added; dev-feedback 2nd-opinion removed
Replying to janbrasna:
I'm fully aware of the mb_ issue, hence the last paragraph.
I don't have a problem with writing the patch conditionally, however if you look at the current code, there are mb_ functions already used without a check for mb_ extension.
All new code must work even if the mb_ functions aren't there.
The problem is that mb_ functions are not on all hosts, so you'll have intermittent issues on some hosts and not on others. Probably won't be fixed completely until PHP6 is out in 2020 or sometime.