From 5c75f4cc75fc829b1d3a2e161e9f635271d13133 Mon Sep 17 00:00:00 2001 From: Peter Westwood Date: Wed, 19 Dec 2007 17:34:15 +0000 Subject: [PATCH] Don't create empty tags. Fixes #5412 props ionfish git-svn-id: https://develop.svn.wordpress.org/trunk@6407 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/post.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-includes/post.php b/wp-includes/post.php index a7a713d35a..f7d31176bf 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -1187,7 +1187,7 @@ function wp_set_post_tags( $post_id = 0, $tags = '', $append = false ) { if ( empty($tags) ) $tags = array(); - $tags = (is_array($tags)) ? $tags : explode( ',', $tags ); + $tags = (is_array($tags)) ? $tags : explode( ',', trim($tags, " \s\n\t\r\0\x0B,") ); wp_set_object_terms($post_id, $tags, 'post_tag', $append); }