Make WordPress Core

Opened 19 years ago

Closed 19 years ago

Last modified 18 years ago

#1647 closed defect (bug) (fixed)

Broken trackback ping in UTF-8

Reported by: thinkini's profile thinkini Owned by:
Milestone: Priority: normal
Severity: normal Version: 1.5.2
Component: General Keywords: bg|needs-patch trackback utf-8
Focuses: Cc:

Description

Wordpress cuts excerpt with substr function
It works well in case of single byte word.
But multi bytes word is cut incoreectly.
The last letter of cut word is broken.

Wordpress changes encoding automatically using mb_convert_encoding.
If the last letter is broken, Wordpress understands that trackback is not UTF-8.
Then trackback is converted UTF-8 by mb_convert_encoding.
it means, all contents in the trackback is broken except the single byte word.

Wordpress uses mbstring module for international trackback.
So open /wp-includes/functions-post.php and find do_trackbacks function

$excerpt = substr($excerpt, 0, 252) . '...';

replace it with

if ( function_exists('mb_strcut') ) For international trackbacks

$excerpt = mb_strcut($excerpt, 0, 252, get_settings('blog_charset')) . '...';

else

$excerpt = substr($excerpt, 0, 252) . '...';

Change History (5)

#1 @markjaquith
19 years ago

  • Keywords bg|needs-patch added; trackback utf-8 removed

#2 @markjaquith
19 years ago

  • Keywords trackback utf-8 added

#3 @ryan
19 years ago

  • Milestone changed from 1.5.2 to 1.6

#4 @matt
19 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [3081]) Cut international trackbacks, fixes #1647

#5 @(none)
18 years ago

  • Milestone 2.0 deleted

Milestone 2.0 deleted

Note: See TracTickets for help on using tickets.