[wp-trac] [WordPress Trac] #47953: Deleting a comment results in 'nbsp; ' in total comments count

WordPress Trac noreply at wordpress.org
Fri Aug 30 18:28:03 UTC 2019


#47953: Deleting a comment results in 'nbsp;' in total comments count
----------------------------+-----------------------------
 Reporter:  SergeyBiryukov  |      Owner:  (none)
     Type:  defect (bug)    |     Status:  new
 Priority:  normal          |  Milestone:  5.3
Component:  Comments        |    Version:
 Severity:  normal          |   Keywords:  has-screenshots
  Focuses:  administration  |
----------------------------+-----------------------------
 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.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/47953>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list