Opened 18 years ago
Closed 18 years ago
#5253 closed defect (bug) (fixed)
filter category_description call too many (2) in category_description() function
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | 2.5 | Priority: | high |
| Severity: | normal | Version: | 2.3 |
| Component: | General | Keywords: | sanitize_term_field get_term_field needs-patch |
| Focuses: | Cc: |
Description
Continuing the taxomony exploration (#5245) for multilingual tests (dev.xiligroup.com), I discover that the filter category_description was called two times. After uneasy research, I found that the origin is that
in get_term_field('description', $category, 'category') the function sanitize_term_field() was called one time too much : one by get_term and one for the field in the return...
function get_term_field( $field, $term, $taxonomy, $context = 'display' ) {
$term = (int) $term;
$term = get_term( $term, $taxonomy ); /* ------- sanitize here ?????? */
if ( is_wp_error($term) )
return $term;
if ( !is_object($term) )
return '';
if ( !isset($term->$field) )
return '';
/* or here - need to choose */
return sanitize_term_field($field, $term->$field, $term->term_id, $taxonomy, $context);
}
Change History (3)
Note: See
TracTickets for help on using
tickets.
(In [6311]) Fix raw context filtering for terms. see #5253