WordPress.org

Make WordPress Core

Opened 6 weeks ago

Closed 6 weeks ago

#47953 closed defect (bug) (fixed)

Deleting a comment results in 'nbsp;' in total comments count

Reported by: SergeyBiryukov Owned by: SergeyBiryukov
Milestone: 5.3 Priority: normal
Severity: normal Version:
Component: Comments Keywords: has-screenshots
Focuses: administration Cc:
PR Number:

Description

Background: #10373, #15530.

Reported by @denisco.

In locales using a space as a thousands separator, it's replaced with   to avoid wrapping, see [35884] / [35951] for #10373.

In comments list table, when deleting a comment, the total comments count is updated via AJAX using jQuery .text() function, which doesn't allow HTML. See [17354] for #15530.

Steps to reproduce:

  1. Switch to a language where thousands separator is a space, e.g. Russian.
  2. Make sure you have a thousand or more comments.
  3. Go to the Comments screen and delete a comment.
  4. In the items count you'll see 1 000 items or similar.

The easiest solution would probably be to replace text() with html(). However, since this counter doesn't need any other HTML, I'm inclined to just account for the   there.

Attachments (1)

47953.PNG (2.2 KB) - added by SergeyBiryukov 6 weeks ago.

Download all attachments as: .zip

Change History (2)

@SergeyBiryukov
6 weeks ago

#1 @SergeyBiryukov
6 weeks ago

  • Owner set to SergeyBiryukov
  • Resolution set to fixed
  • Status changed from new to closed

In 45918:

Comments: In AJAX response when deleting a comment, account for   as a thousands separator in total_items_i18n and total_pages_i18n numbers.

Props denisco, SergeyBiryukov.
Fixes #47953.

Note: See TracTickets for help on using tickets.