Opened 6 weeks ago
Closed 6 weeks ago
#64383 closed defect (bug) (reported-upstream)
wp-includes/js/dist/i18n.js sprintf function breaks on empty string
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Severity: | normal | Version: | 6.9 |
| Component: | I18N | Keywords: | needs-patch |
| Focuses: | Cc: |
Description
Older WooCommerce admin analytics pages generat empty strings, which breaks in the i18n sprintf() method.
This happens on the analytics overview page in React components (/wp-admin/admin.php?page=wc-admin&path=analytics-overview)
Is there a reason that the string variable isn't checked before the replace?
https://github.com/WordPress/WordPress/blob/master/wp-includes/js/dist/i18n.js#L172
Happens and tested on WooCommerce versions:
- 9.6.1
- 9.6.2
- 9.8.4
- 9.9.4
- 9.9.5
Change History (3)
#1
@
6 weeks ago
- Summary changed from wp-includes/js/dist/i18n.js sprintf function break on empty string to wp-includes/js/dist/i18n.js sprintf function breaks on empty string
#3
@
6 weeks ago
- Milestone Awaiting Review deleted
- Resolution set to reported-upstream
- Status changed from new to closed
Hi there and welcome to WordPress Trac
I think we're discussing this already in https://github.com/WordPress/gutenberg/issues/70824
While the code had a more defensive approach before, it's really the plugin doing something wrong by passing undefined. Since WooCommerce fixed this a long time ago, we suggest updating the plugin.
There were no other plugins doing it wrong, so there was no need for a revert on the WordPress side.
Also happens and tested on WooCommerce versions:
WooCommerce fixed this in version 10.0.4