mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 09:37:42 +01:00
Make sure IDs are >= 0. see #6305
git-svn-id: http://svn.automattic.com/wordpress/trunk@7481 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
da305bbce0
commit
bc1e8fd755
@ -796,8 +796,11 @@ function sanitize_term($term, $taxonomy, $context = 'display') {
|
||||
* @return mixed sanitized field
|
||||
*/
|
||||
function sanitize_term_field($field, $value, $term_id, $taxonomy, $context) {
|
||||
if ( 'parent' == $field || 'term_id' == $field || 'count' == $field || 'term_group' == $field )
|
||||
if ( 'parent' == $field || 'term_id' == $field || 'count' == $field || 'term_group' == $field ) {
|
||||
$value = (int) $value;
|
||||
if ( $value < 0 )
|
||||
$value = 0;
|
||||
}
|
||||
|
||||
if ( 'raw' == $context )
|
||||
return $value;
|
||||
|
Loading…
Reference in New Issue
Block a user