#6637 closed defect (bug) (fixed)
wp_widget_categories() doesn't handle html entities in description
| Reported by: | guillep2k | Owned by: | guillep2k |
|---|---|---|---|
| Priority: | normal | Milestone: | 2.6 |
| Component: | I18N | Version: | 2.5 |
| Severity: | normal | Keywords: | has-patch tested |
| Cc: | Focuses: |
Description
At wp-includes/widgets.php:694, the following line:
wp_dropdown_categories($cat_args . '&show_option_none= ' . __('Select Category'));
Doesn't handle html entities coming from __() translation, since they contain ampersands. To correct this, we can change it to:
wp_dropdown_categories($cat_args . '&show_option_none= ' . urlencode(__('Select Category')));
This is easily seen in Spanish (es_ES.po file can be found here: http://reyson.re.funpic.de/downloads/wp2.5-es_ES-po.rar), where 'Select Category' translates to 'Seleccionar Categoría'.
Attachments (2)
Change History (12)
#4
@
18 years ago
- Keywords tested added
Tested the patch in 2.5.1 with LANG = es_ES. The "Select Category" option is translated to "Seleccionar Categoría"; without the patch it's shown as "Seleccionar Categor", as the í is taken as another query variable.
#5
follow-up:
↓ 6
@
18 years ago
We should use the array calling style to avoid the vagaries of query strings. Try out this patch.
#6
in reply to: ↑ 5
@
18 years ago
Replying to ryan:
We should use the array calling style to avoid the vagaries of query strings. Try out this patch.
New patch works perfect for me. I applied it to 2.5.1, though, which is what my wife has on her blog (not trunk).
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Added a patch for the proposed change.