#16611 closed defect (bug) (fixed)
Too few arguments to sprintf in WP_List_Table::comments_bubble()
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | 3.1 | Priority: | high |
Severity: | normal | Version: | 3.1 |
Component: | General | Keywords: | has-patch commit |
Focuses: | Cc: |
Description
Not really sure where the bug is, but looks legit:
http://wordpress.org/support/topic/warning-sprintf-functionsprintf-too-few-arguments?replies=1
Attachments (5)
Change History (22)
#3
@
14 years ago
- Keywords commit added
- Version set to 3.1
Ah, right, because sprintf() thinks those encoded chars are placeholders. Makes sense now.
#5
@
14 years ago
- Keywords commit removed
The URL should also be escaped.
Regardless, patch leaves an issue, due to the nature of comments_number(). If comments > 1, then comments_number() will do an str_replace() on the %. This borks the URL.
#6
@
14 years ago
Proper function here is get_comments_number(), wrapped with number_format_i18n(). Anything else is extra we don't need or leverage, due to the arguments we pass comments_number().
#8
@
14 years ago
- Keywords commit added
I was wondering why we were using comments_number() like this.
In 3.0, we had code that looked like the red in r15504 -- basically, massive strings going into comments_number(). We also didn't wrap the link in admin_url(), thus we had no extra percentages to screw things up. sprintf() plus admin_url(), two pretty innocuous changes, caused the regression.
The smarter structuring in r15504 in turn revealed that get_comments_number() is a better approach.
#12
@
14 years ago
- Resolution fixed deleted
- Status changed from closed to reopened
16611.2.diff doesn't fix the initial issue. printf()
throws the same error message, as there are still encoded chars in the URL.
Added new patch.
#15
@
14 years ago
I was going to cycle back around and just string concatenate this, but decided to leave it for 3.2. Didn't see the extra bug in my testing.
Looks good. Commit and ship.
Can reproduce with non-English characters in
siteurl
. The link becomes something like this: