Make WordPress Core

Opened 5 years ago

Closed 12 months ago

#15827 closed defect (bug) (duplicate)

AJAX paging breaks badly when json_encode can't encode

Reported by: westi Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.1
Component: Administration Keywords: has-patch dev-feedback
Focuses: Cc:


If json_encode can't encode a response for some reason you get no feedback at all except for a blank list.

This seems most likely to trigger with invalid UTF8 sequences in spam comments.

With non-ajax paging you at least get all the comments displayed even if you do get a lot of ??? for the bad chars

Example Error seen:

[15-Dec-2010 14:18:38] Warning: json_encode() [<a href='function.json-encode'>function.json-encode</a>]: Invalid UTF-8 sequence in argument in /home/wpdev/public_html/wp-admin/includes/class-wp-list-table.php on line 839 [

Attachments (2)

15827.patch (1.1 KB) - added by SergeyBiryukov 5 years ago.
15827.diff (1.1 KB) - added by MikeHansenMe 16 months ago.

Download all attachments as: .zip

Change History (10)

comment:1 @filosofo5 years ago

This is one reason I proposed a standard way of doing Ajax in #14618: it handles erroneous or syntactically invalid responses in a consistent manner.

In this case we could pass the href attribute value to the error handler and have it set location.href to load the requested page when Ajax paging fails.

comment:2 @ryan5 years ago

  • Milestone changed from 3.1 to Future Release

@SergeyBiryukov5 years ago

comment:3 @SergeyBiryukov5 years ago

We can attempt to fix invalid characters with wp_check_invalid_utf8(). Patch included.

Version 0, edited 5 years ago by SergeyBiryukov (next)

comment:4 @SergeyBiryukov5 years ago

  • Keywords has-patch added

comment:5 @scribu5 years ago

  • Cc scribu added
  • Owner scribu deleted
  • Status changed from new to assigned

@MikeHansenMe16 months ago


comment:7 @chriscct712 months ago

  • Keywords dev-feedback added

comment:8 @pento12 months ago

  • Milestone Future Release deleted
  • Resolution set to duplicate
  • Status changed from assigned to closed

Duplicate of #28786.

Note: See TracTickets for help on using tickets.