From e52d7eee0bd0cf8c3f44e97372e62b10e7614d76 Mon Sep 17 00:00:00 2001 From: ryan 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: http://svn.automattic.com/wordpress/trunk@11151 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- 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;