Ticket #1647 (closed defect: fixed)

Opened 3 years ago

Last modified 2 years ago

Broken trackback ping in UTF-8

Reported by: thinkini Assigned to: 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

09/02/05 16:47:44 changed by markjaquith

  • keywords changed from trackback utf-8 to bg|needs-patch.

09/02/05 17:19:57 changed by markjaquith

  • keywords changed from bg|needs-patch to bg|needs-patch trackback utf-8.

09/02/05 22:02:55 changed by ryan

  • milestone changed from 1.5.2 to 1.6.

11/14/05 10:14:43 changed by matt

  • status changed from new to closed.
  • resolution set to fixed.

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

11/30/06 19:41:47 changed by

  • milestone deleted.

Milestone 2.0 deleted