From d0b30bee2a00265f6ea7dbd6e3db04c0a611e6df Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Fri, 1 May 2009 20:59:14 +0000 Subject: [PATCH] Trim term before checking if it already exists. Props jhodgdon. fixes #9397 git-svn-id: https://develop.svn.wordpress.org/trunk@11151 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/taxonomy.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/wp-includes/taxonomy.php b/wp-includes/taxonomy.php index 662bfe4eb9..ef485974cb 100644 --- a/wp-includes/taxonomy.php +++ b/wp-includes/taxonomy.php @@ -865,6 +865,8 @@ function is_term($term, $taxonomy = '', $parent = 0) { return $wpdb->get_var( $wpdb->prepare( $select . $where, $term ) ); } + $term = trim( $term ); + if ( '' === $slug = sanitize_title($term) ) return 0;