Ticket #1647 (closed defect (bug): fixed)

Opened 6 years ago

Last modified 5 years ago

Broken trackback ping in UTF-8

Reported by: thinkini Owned by: anonymous
Priority: normal Milestone:
Component: General Version: 1.5.2
Severity: normal Keywords: bg|needs-patch trackback utf-8
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

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

comment:3   ryan6 years ago

  • Milestone changed from 1.5.2 to 1.6

comment:4   matt6 years ago

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

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

  • Milestone 2.0 deleted

Milestone 2.0 deleted

Note: See TracTickets for help on using tickets.