Make WordPress Core

Opened 6 years ago

Last modified 5 years ago

#45389 reviewing defect (bug)

trackback_url_list() trackback excerpt for multibyte correspondence

Reported by: ishitaka's profile ishitaka Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: Future Release Priority: normal
Severity: normal Version:
Component: Pings/Trackbacks Keywords: has-patch dev-feedback needs-unit-tests
Focuses: Cc:


In the case of multibyte, the last letter of the trackback excerpt may be garbled.

Attachments (3)

45389.patch (541 bytes) - added by ishitaka 6 years ago.
result.png (16.6 KB) - added by mukesh27 6 years ago.
Browser screenshot
45389.2.patch (556 bytes) - added by mukesh27 6 years ago.
updated patch with mb_substr function.

Download all attachments as: .zip

Change History (6)

6 years ago

#1 @mukesh27
6 years ago

  • Component changed from General to Pings/Trackbacks
  • Keywords dev-feedback added

@ishitaka Yes when system use Japanese language then it show garbage value for post excerpt.

For example:

        $excerpt = 'ポップアップ表示されるメッセージのことでしょうか?このメッセージは、ブラウザによるフォームの妥当性チェックにより表示されるメッセージ(ブラウザによってメッセージは違うかも?)です。変更するのはそれなりの作業が必要そう(たぶん?)なので、下記のようにするのはどうでしょうか?';
        echo 'substr: '. substr( $excerpt, 0, 20 );
        echo 'mb_strcut: '.mb_strcut($excerpt, 0, 20 );
        echo 'mb_substr: '.mb_substr( $excerpt, 0, 20 );

Above example shows below result.

        substr: ポップアップ�
        mb_strcut: ポップアップ
        mb_substr: ポップアップ表示されるメッセージのことで

mb_substr function return true value for an excerpt.

attached updated patch and browser screenshot for more information.

6 years ago

Browser screenshot

6 years ago

updated patch with mb_substr function.

#2 @SergeyBiryukov
5 years ago

  • Keywords needs-unit-tests added
  • Milestone changed from Awaiting Review to 5.1
  • Owner set to SergeyBiryukov
  • Status changed from new to reviewing

#3 @pento
5 years ago

  • Milestone changed from 5.1 to Future Release

This ticket needs unit tests.

Note: See TracTickets for help on using tickets.