WordPress.org

Make WordPress Core

Opened 11 months ago

Last modified 9 months ago

#45389 reviewing defect (bug)

trackback_url_list() trackback excerpt for multibyte correspondence

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

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 11 months ago.
result.png (16.6 KB) - added by mukesh27 11 months ago.
Browser screenshot
45389.2.patch (556 bytes) - added by mukesh27 11 months ago.
updated patch with mb_substr function.

Download all attachments as: .zip

Change History (6)

@ishitaka
11 months ago

#1 @mukesh27
11 months 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
11 months ago

Browser screenshot

@mukesh27
11 months ago

updated patch with mb_substr function.

#2 @SergeyBiryukov
11 months 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
9 months ago

  • Milestone changed from 5.1 to Future Release

This ticket needs unit tests.

Note: See TracTickets for help on using tickets.