[wp-trac] [WordPress Trac] #37103: get_comments_number_text() should not replace '%' in post title

WordPress Trac noreply at wordpress.org
Wed Nov 9 17:12:27 UTC 2016


#37103: get_comments_number_text() should not replace '%' in post title
------------------------------------------+-----------------------------
 Reporter:  SergeyBiryukov                |       Owner:
     Type:  defect (bug)                  |      Status:  new
 Priority:  normal                        |   Milestone:  Future Release
Component:  Comments                      |     Version:  4.2
 Severity:  normal                        |  Resolution:
 Keywords:  needs-patch needs-unit-tests  |     Focuses:
------------------------------------------+-----------------------------
Changes (by johnbillion):

 * keywords:  has-patch needs-testing => needs-patch needs-unit-tests


Comment:

 Thanks for the patch, @andizer, but your change means that the string `%
 Comments` would be turned into `2` instead of `2 Comments`.

 I think the fix is to replace any `%` symbols in the post title with a
 placeholder (such as `__PERCENT__`), do the comment number replacement,
 and then swap the placeholder back out for a `%`.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/37103#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list