Opened 10 years ago
Closed 10 years ago
#34619 closed defect (bug) (fixed)
Avoid using HTML tags in translation strings (wp-admin/includes/upgrade.php)
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 4.4 | Priority: | normal |
Severity: | normal | Version: | |
Component: | I18N | Keywords: | has-patch commit |
Focuses: | Cc: |
Description
Found a wrong use of str_replace()
in translations strings. We should use sprintf()
instead.
See the attached patch fixing this issue.
Attachments (3)
Change History (12)
#2
@
10 years ago
- Summary changed from Use sprintf() instead of str_replace() in translations strings to Avoid using HTML tags in translation strings (wp-admin/includes/upgrade.php)
#4
follow-up:
↓ 5
@
10 years ago
The same string is also used in tags/4.3.1/src/wp-admin/includes/schema.php#L977.
It's a site option used for newly created sites in Multisite. We can't remove str_replace()
here, it would still be needed for back-compat with the stored text.
#5
in reply to:
↑ 4
;
follow-ups:
↓ 6
↓ 8
@
10 years ago
Can we use sprintf()
strings in both places?
#6
in reply to:
↑ 5
@
10 years ago
Replying to ramiy:
Can we use
sprintf()
strings in both places?
Haven't tested yet, but I think it was done this way because network_home_url()
or get_current_site()
is not available yet when populate_network()
run for the first time.
#8
in reply to:
↑ 5
@
10 years ago
- Keywords commit added
- Milestone changed from Awaiting Review to 4.4
Replying to ramiy:
Can we use
sprintf()
strings in both places?
On second thought, I think 34619.3.patch might work.
We still need str_replace()
for back-compat, but at least the string would now be correct.
The second patch better - this way we avoid using HTML tags in the translation strings.