#6637 closed defect (bug) (fixed)
wp_widget_categories() doesn't handle html entities in description
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 2.6 | Priority: | normal |
Severity: | normal | Version: | 2.5 |
Component: | I18N | Keywords: | has-patch tested |
Focuses: | Cc: |
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
@
17 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
@
17 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
@
17 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).
Added a patch for the proposed change.