Make WordPress Core

Opened 6 years ago

Last modified 6 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:

Description

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)

@ishitaka
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:

<?php
        $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.

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

mb_substr function return true value for an excerpt.

attached updated patch and browser screenshot for more information.

@mukesh27
6 years ago

Browser screenshot

@mukesh27
6 years ago

updated patch with mb_substr function.

#2 @SergeyBiryukov
6 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
6 years ago

  • Milestone changed from 5.1 to Future Release

This ticket needs unit tests.

Note: See TracTickets for help on using tickets.