Make sure IDs are >= 0. see #6305
git-svn-id: https://develop.svn.wordpress.org/trunk@7481 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
e8088c9af3
commit
24a6304824
@ -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